using System;

namespace _4
{
    class Program
    {
        static void Cenzura(string n, string x)
        {
            char[] k = n.ToCharArray();
            char[] s = x.ToCharArray();
            int p = 0;
            for(int i = 1; i < x.Length - 1; i++)
            {
                for(int j = 1; j < n.Length - 1; j++)
                {
                    if (s[i] == k[j] && s[i - 1] == k[j - 1] && s[i + 1] == k[j + 1])
                    {
                        k[j] = '*';
                        p++;
                    }
                }
            }
            Console.WriteLine(p);
            Console.WriteLine(new string(k));
        }
        static void Main(string[] args)
        {
			string n = Console.ReadLine();
			string x = Console.ReadLine();
            Cenzura(n, x);
        }
    }
}