import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines S = read().rstrip() c = S.count(b'c') w = len(S) - c answer = min(c-1, w) print(answer)