e;main(h){while(read(0,&h,1))e+=h>>4?"JH¡1Q$2"[61+~h/2]>>h%2*4&15:!printf("%d\n",e)-e;}