import Data.List main = getLine >>= print . tree tree s = length $ takeWhile (==4) $ zipWith (-) s' (tail s') where s' = map length $ iterate (\\ "tree") s