#include using namespace std; typedef long long ll; int main(){ int c, w; c = w = 0; string s; cin >> s; for (auto t : s){ if (t == 'c') c++; else w++; } c--; cout << min(c, w) << endl; return 0; }