#include <stdio.h>
#include <stdlib.h>
#include <string.h>


/* run this program using the console pauser or add your own getch, system("pause") or input loop */

int main(int argc, char *argv[]) {
	
	char t[100];
	char s[11];
	
	gets(t);
	
	
	int i;
	

	char a = getchar();
	
	getchar();
	
	char c = '*';
		
	for(i = 0; i < 100; i++){
		if(t[i] == a){
			t[i] = c;
		}
		
		
	}
	
	int d = 0;
	
	for(i = 0; i < 100; i++){
		if(t[i] == c){
			d++;
		}
		
		
	}
	
	printf("%d\n", d);
	puts(t);
	
	
	
	
	return 0;
}