#include "stdio.h" #include "string.h" int main(){ char str[5000] = {0}; char p = str; char m =str; int k = 0; fgets(str,sizeof(str),stdin); while(1){ if((p+1)=='\0'){break;} p++; } while(1){ if((p-1)==' '||*m==*p){break;} p--; k++; } printf("%d",k); return 0; }