#include #include using namespace std; int main(){ string S; cin >> S; for(int i = 0; i < S.size(); i++){ if(S[i] == 'w'){ cout << min(i - 1, int(S.size()) - i) << endl; return 0; } } }