#include using namespace std; using ll = long long; using ld = long double; using u32 = uint32_t; using vi = vector; using vvi = vector; using vb = vector; using vvb = vector; using vl = vector; using vvl = vector; using vd = vector; using vvd = vector; #define REP(i,n) for(auto i = 0 * (n), i##_len = (n); i < i##_len; ++i) #define ALL(c) (c).begin(), (c).end() #define FOR(i,s,n) for(ll i=s, i##_len=(ll)(n); i> s; REP(i, s.size()) { if (s[i] == 'w') { cout << max(0, min(i - 1, s.size() - i)) << endl; return 0; } } cout << 0 << endl; return 0; }