#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; break; } } if(c_count+1 > w_count) printf("%d",w_count); else printf("%d",c_count); return 0; }