def main(): S = input() c = S.count('c') w = S.count('w') if c <= w: ans = c - 1 else: ans = w print(ans) main()