S = input() C = S.count('c') W = S.count('w') print([W, C-1][C < W])