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