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