S = input() if S.count("c") - 1 > S.count("w"): print(S.count("w")) else: print(S.count("c") - 1)