S = input() l = len(S) c = sum(1 for s in S if s == "c") if c <= l - c: print(c-1) else: print(l-c)