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