{-# LANGUAGE OverloadedStrings #-}

import           Control.Monad (unless)
import qualified Data.Text     as T
import qualified Data.Text.IO  as T

main :: IO ()
main = do
    t <- T.getLine
    unless (t == "END OF INPUT") $ do
        (putStrLn . concat . map show . map T.length . T.splitOn " ") t
        main