s=input() c='cww' a=s.index(c) b=s[::-1].index(c[::-1]) print(min(ab))