#include using namespace std; #ifdef LOCAL #include "settings/debug.cpp" #else #define Debug(...) void(0) #endif #define rep(i, n) for (int i = 0; i < (n); ++i) using ll = long long; using ull = unsigned long long; int main() { string s; cin >> s; int cnt1 = 0, cnt2 = 0; rep(i, s.size()) { if (s[i] == 'c') cnt1++; else break; } for (int i = s.size() - 1; i >= 0; --i) { if (s[i] == 'w') cnt2++; else break; } cout << min(cnt1 - 1, cnt2) << endl; return 0; }