#include using namespace std; int main() { string s; cin >> s; int cntC = count(s.begin(), s.end(), 'c'); int cntW = s.length() - cntC; cout << min(cntC - 1, cntW) << endl; return 0; }