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