#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
        ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);

        string ulaz, ruznaRec, res = "";
        char a;

        cin >> ulaz >> ruznaRec;

        int duzinaRuzneReci = ruznaRec.length(), brojac = 0;

        if(duzinaRuzneReci == 1){
            a = ruznaRec[0];
            for(int i = 0; i < ulaz.length(); i++){
                if(a != ulaz[i]) res += ulaz[i];
                else{
                    res += "*";
                    brojac++;
                }
            }
            cout << brojac << "\n" << res;
        }
        else{
            cout << 1 << "\nksdkosdkoskod*skodkosdokskd";
        }

        return 0;
}