#include int main() { int n,sum=10,i; for(i=2;i<=100;i++){ sum=sum*10; } char buf[sum]; scanf("%d",&n); sprintf(buf,"%d",n); i=0; while(1){ if(buf[i]=='\0'){ if(buf[i-1]=='3'){ printf("%d\n",i); break; }else{ printf("-1\n"); break; } } if(buf[i]!='3'){ printf("-1\n"); break; } i++; } return 0; }