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