S=input() RS=S[::-1] print(min(S.index("ccw"),RS.index("wcc"))+1)