import re N = input() cnt = 0 if "ccw" in N: p = N.find("ccw") if p < len(N)//2: while "ccw" in N: N = re.sub("^(c|w)","",N) cnt += 1 else: while "ccw" in N: N = re.sub("(c|w)$","",N) cnt += 1 print(cnt)