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