let () =
  let rec read () =
    let line = read_line () |> String.trim in
    if line = "END OF INPUT" then
      ()
    else
      let n = (Str.split (Str.regexp " ") line
               |> List.fold_left (fun x y -> x^(String.length y |> string_of_int)) "") in
      Printf.printf "%s\n" n;
      read ()
  in read ();;