#include int min(int a, int b) { return a < b ? a : b; } char s[100000]; int c, w; int main() { gets(s); for (int i = 0; s[i]; i++) { if (s[i] == 'c') c++; else w++; } printf("%d\n", min(c-1, w)); return 0; }