s = input() c, w = 0, 0 for i in range(len(s)): if s[i] == "c": c += 1 else: w += 1 print(min(c - 1, w))