S = input() N = len(S) c = S.count("c") w = N - c ans = min(c - 1, w) print(ans)