s = input() c = s.count('c') w = s.count('w') if c > w: print(w) else: print(c - 1)