#include int main(){ char S[100001]; scanf("%s",S); int count_c,count_w; int i = 0; while(1){ if(S[i]=='\0') break; else if(S[i]=='c') count_c++; else count_w++; i++; } if(count_w >= count_c) printf("%d\n", count_c-1); else printf("%d\n", count_w); return 0; }