S = input() N = len(S) # 右端から消すか左端から消すか if not 'ccw' in S: print('0') exit() ss = 'ccw' a1 = 0 for i in range(N-2): if S[i:i+3] == 'ccw': a1 = i a2 = N-1 for i in range(N,2,-1): if S[i-3:i] == 'ccw': a2 = i print(min(a1+1,N-a2+1))