s=input() c='ccw' a=s.index(c) b=s[::-1].index(c[::-1]) print(min(a+1,b+1))