import Data.List main=do str<-getLine let ci = elemIndices 'c' str let wi = elemIndices 'w' str print $ minimum $ take 1 =<< [drop 1[w-c+1|w<-wi,w>c]|c<-ci]