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