s=input() x=s.find('ccw') print(min(x+1,len(s)-x-2))