#include #include typedef unsigned long long ul; typedef signed long long ll; int main(void) { std::cin.tie(0); std::ios::sync_with_stdio(false); std::cout << std::fixed << std::setprecision(15); std::string s; std::cin >> s; ll c = 0, w = 0; for (auto ch : s) { if (ch == 'c') c++; else w++; } std::cout << std::min(c-1, w) << std::endl; return 0; }