using System;
using System.Collections.Generic;
using System.Linq;

namespace Takmicenje
{
    class Program
    {
        static void Main()
        {
            string s = Console.ReadLine();
            string t = Console.ReadLine();
            string resenje = "";
            int brojZvezdica = 0;
            if (t.Length == 1)
            {

                for (int i = 0; i < s.Length; i++)
                {
                    if (Convert.ToString(s[i]) != t)
                    {
                        resenje+=s[i];
                    }
                    else
                    {
                        brojZvezdica++;
                        resenje+="*";
                    }
                }
            }
            Console.WriteLine(brojZvezdica);
            Console.WriteLine(resenje);
        }
    }
}