import Control.Monad
import Data.List.Split

solver :: String -> [String]
solver xs = map (show . length) $ splitOn " " xs


main :: IO()
main = do
  line <- getLine
  unless (line == "END OF INPUT") $
    do putStrLn $ concat $ solver line
       main