#include <iostream>
#include<bits/stdc++.h>

using namespace std;

int main() {
  string t,s;
  int i;
  int sum = 0;
  int n = 0;

  cin >> t >> s;

  for (i = 0; i < t.size(); i++) {
    if (t[i] == s[0]) sum++;
      else sum = 0;
    if (sum >= s.size()){
      t[i] = '*';
      sum = 0;
      n++;
    }
  }
  cout << n << "\n" << t;
}