#include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define Would #define you const int INF = 999999999; const int MOD = 1e9 + 7; int main() { int mon; string h; cin >> h; for (int i = 2; i < h.length(); ++i) { if (h[i] == 'w'&&h[i - 1] == 'w'&&h[i - 2] == 'c') { mon = i; } } cout << min((long long)h.length() - mon, (long long)mon) << endl; }