s,r=input(),range l=len(s) print(max([max([j-i+1 if s[i]+s[j]=='cw' and 'w'in s[i+1:j] else -1 for j in r(i,l)]) for i in r(0,l)]))