#include #include int main() { int i, c_count, w_count; char S[100003]; for(i=0; ;i++){ scanf("%c",&S[i]); if(S[i] == 'w') c_count = i; if(S[i] == '\0'){ w_count = i-c_count-1; break; } printf("%d\n",i); } if(c_count+1 > w_count) printf("%d\n",w_count); else printf("%d\n",c_count-1); return 0; }