{-# LANGUAGE OverloadedStrings #-}

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

convertToSequence :: T.Text -> [Int]
convertToSequence = convertToSequence' . T.words . T.replace "  " " * "
    where
        convertToSequence' (t : []) = [if t == "*" then 0 else T.length t]
        convertToSequence' (t : ts)
            | t == "*" = 0 : convertToSequence' ts
            | otherwise = T.length t : convertToSequence' ts

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