import re S = input().strip() txt = 'cww' cnt = 0 pos1 = 0 pos2 = 0 for i in range(len(S)): if S[i] == 'c': if cnt < 2: pos1 = i #print('pos1:{}'.format(pos1)) if cnt == 0: cnt += 1 if S[i] == 'w' and cnt > 0: pos2 = i #print('pos2:{}'.format(pos2)) cnt += 1 if cnt > 2: break else: pos1 = 0 pos2 = -2 print(str(pos2 - pos1 + 1))