i,j,n;main(k,s){for(;k=~scanf("%s",s);printf(atof(s)?"Wait, that's not a number...\n":"%d\n",n))for(i=j=strtol(s,&s,n=0);j%k?j/--k:(n-=i/k,j/=k););}