from collections import Counter s = Counter(list(input())) print(min(s['c'] - 1, s['w']))