import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String a = sc.next();
while(!a.equals("#")) {
String b = sc.nextLine();
int count = 0;
String upper = b.toUpperCase();
String lower = b.toLowerCase();
for(int i = 0; i < b.length(); i++) {
if(a.charAt(0) == upper.charAt(i) || a.charAt(0) == lower.charAt(i)) {
count++;
}
}
System.out.println(a + " " + count);
a = sc.next();
}
sc.close();
}
}
upper.charAt(i)는 char형이다.
a는 String 형이므로, upper.charAt(i)의 형(char)과 똑같이 변형 시켜 주어야 한다.