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