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