char s[9];main(j,a,t){for(;gets(s);){t=strtol(s,s,2);printf("%d\n",t);}}