s=input() c=s.rfind("c") w=s.find("w") if s=="cww"or len(s)<3: print(0) else: if c >w+1: print(w+2) else: print(c+1)