#include // #include using namespace std; // using bigint = boost::multiprecision::cpp_int; template using min_priority_queue = priority_queue,greater>; random_device seed_gen; mt19937 engine(seed_gen()); int64_t get_time_ns(){ struct::timespec t; clock_gettime(CLOCK_MONOTONIC, &t); return t.tv_sec * int64_t(1'000'000'000) + t.tv_nsec; } int main() { string s; cin >> s; int cnt_c = 0; int cnt_w = 0; for(char c : s) { if(c == 'c') cnt_c++; if(c == 'w') cnt_w++; } int ans = min(cnt_c - 1, cnt_w); cout << ans << endl; return 0; }