import Data.List main=do str<-getLine print$case [elemIndices 'w' sub|sub<-tails str, take 1 sub=="c"]>>=take 1.drop 1 of [] -> -1 lns -> 1 + minimum lns