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