#include #include using namespace std; int l,i,j,x,nr,ok,okk,o,a,b,q; char s[110],c[110]; int main(){ while(gets(s)){ l=strlen(s); ok=0; okk=0; b=1; x=0; a=0; q=0; nr=0; for(i=0;i='0'&&okk){ q=q*10+s[i]-'0'; } if(ok==0&&s[i]==' '){ if(c[1]=='c') nr=1; if(c[1]=='i') nr=4; if(c[1]=='s') nr=2; ok=1; if(c[1]=='u'){ ok=0; a=0; } } } if(b!=1) x+=b*nr; if(s[l-1]>='a'&&s[l-1]<='z') x+=nr; printf("%d\n",x); } return 0; }