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