#include #include int main(void) { int c = 0; int w = 0; int i; int j; int l; char s[100001]; scanf("%s",s); l = strlen(s); j = l / 2; while (s[j] == 'w') { j = j / 2; } for (i = j;i < l;i++) { if(s[i] == 'w') { c = i; w = l - c; break; } } if (c-1 > w) { printf("%d\n",w); } else { printf("%d\n",c-1); } return 0; }