while 1: k=1 for c in input():n=ord(c)%12-1;k=8*k+n>>6*(k%8^n==4) print(1//k)