#include using namespace std; int main(void) { cin.tie(0); ios::sync_with_stdio(false); string s; cin >> s; int cntc = 0; int cntw = 0; for(auto it : s) { if(it=='c') cntc++; else cntw++; } int res = max(0,cntc-1); res = min(res,max(0,cntw)); cout << res << '\n'; return 0; }