using System;
using System.Text;

namespace cetvrti_uopa
{
    class Program
    {
        static void Main(string[] args)
        {
            string t = Console.ReadLine();
            string s = Console.ReadLine();
            int brojac = 0;
            int brojac2 = 0;
            StringBuilder novi = new StringBuilder();
            for (int i = 0;i<t.Length;i++)
            {
                if (t[i] == s[0] && brojac < s.Length) brojac++;
                if (brojac != s.Length) novi.Append(t[i]);
                else  if (t[i] != s[0] && brojac == s.Length) novi.Append(t[i]);
                else
                {
                    novi.Append('*');
                    brojac2++;
                }
                
            }
            Console.WriteLine(brojac2);
            Console.WriteLine(novi.ToString());
            
        }
    }
}