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