import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
StringBuffer sb = new StringBuffer("");
int n = Integer.parseInt(br.readLine());
String m = "";
for(int i=1;i<n+1;i++) {
m=br.readLine();
int sum=0;
sb.append("Case #").append(i).append(": ");
for(int j=0;j<m.length();j++){
sum+=check(m.charAt(j));
}
sb.append(sum).append("\n");
}
System.out.print(sb);
}
static int check(char x){
if(x=='b' ||x=='e'||x=='h'
||x=='k'||x=='n'||x=='q'
||x=='u'||x=='x')
return 2;
if(x=='c' ||x=='f'||x=='i'
||x=='l'||x=='o'||x=='r'
||x=='v'||x=='y')
return 3;
if(x=='s'||x=='z')
return 4;
return 1;
}
}
No comments:
Post a Comment