s = input() c = False w=0 start = 0 for i in range(len(s)): if s[i]=="c": c=True start = i if c==True and s[i]=="w": w+=1 if w==2: break length= i-start+1 if w==2: print(start) else: print(-1)