s;main(c,i){for(;read(0,&c,1);printf("%d\n",i?i-s:12-(c%97%65<26)))i=index(s="\\{}$&y#^_y yy~%",c);}