#include <bits/stdc++.h>
using namespace std;
int main()
{
long long int i,k,l,m,n,j,t,v,sum;
//char s[1000000];
//freopen("11530.txt","r",stdin);
//freopen("11530out.txt","w",stdout);
string s;
char c,a[105];
cin>>n;
m=1;
for(j=97;j<=121;j++)
{
if((j!=115))
{
c=j;
a[m]=c;
//cout<<m<<" "<<a[m]<<endl;
m++;
}
}
a[25]=' ';
for(i=1;i<=n;i++)
{
if(i==1)
{
scanf("%c",&c);
}
getline(cin,s);
sum=0;
//cout<<s.length()<<endl;
for(k=0;k<s.length();k++)
{
if(s[k]=='s' || s[k]=='z')
{
sum=sum+4;
}
for(l=1;l<=25;l++)
{
if(a[l]==s[k])
{
t=l%3;
if(t==0)
{
v=3;
}
else if(t==1)
{
v=1;
}
else if(t==2)
{
v=2;
}
sum=sum+v;
//cout<<a[l]<<" "<<v<<endl;
}
}
}
printf("Case #%lld: %lld\n",i,sum);
}
return 0;
}
0 comments:
Post a Comment