import re s = input() m = re.search("ccw", s) if m.start() +1 <= len(s)- m.start()-2: print(m.start()+1) else: print(len(s)- m.start()-2)