a = input() line = list(a) c_count = line.count("c") w_count = line.count("w") if c_count > w_count: print(w_count) else: print(c_count-1)