main(int c,char*s){for(;gets(s);printf("%d\n",c))for(c=0;*s;c=c*strlen(s)+*s++-48);}