Go: package main

import (
	"bufio"
	"fmt"
	"os"
	"strings"
)

var sc = bufio.NewScanner(os.Stdin)

func main() {
	for sc.Scan() {

		str := sc.Text()

		if str == "END OF INPUT" {
			break
		}

		strs := strings.Split(sc.Text(), " ")

		for _, s := range strs {
			fmt.Print(len(s))
		}

		fmt.Println()
	}

}

Python: while True:
    i = input()
    if i == "END OF INPUT":
        break
    print("".join(map(str, [len(x) for x in i.split()])))

Python: # coding: utf-8
# Your code here!

while True:
   s = input()
   if s == "END OF INPUT": break
   
   s += " " #文字列の文末にスペースを加える
   #print(s)
   
   c = 0
   for i in range(len(s)):
      #print(s[i])
      if s[i] == ' ':
         print(c, end = "")
         c = 0
         continue
      c += 1
   print("")

Python: while True :
    S = input()
    
    if S == "END OF INPUT" :
        break
    
    else :
        S += " "
        N = []
        s = 0
        b = 0
        
        for i in range(len(S)) :
            if S[i] != " " :
                s += 1
            else :
                b += 1
                if b == 1 :
                    N.append(s)
                    s = 0
                    b = 0
                else :
                    N.append(0)
                    b = 0
  
        for i in range(len(N)) :
            if i == len(N) - 1 :
                print(N[i])
            else :
                print(N[i], sep = "", end = "")

Python: ans = ''
s = ''
while 1:
	s = raw_input()
	if s == 'END OF INPUT':
		break
	s = s.replace(' ', '0').split('0')
	for i in s:
		ans += str(len(i))
	ans += '\n'
	
print(ans.rstrip('\n'))

Python: while 1:
    inp=input()
    if(inp=="END OF INPUT"):
        break
    print(''.join(map(str,map(len,inp.split(' ')))))

Python: while True:
    ans=[]
    n=input()
    if n=="END OF INPUT":
        break
    else:
        a=n.split(' ')
        for i in range(len(a)):
            ans.append(len(a[i]))
        print(*ans,sep="")

Python: while True:
    n=input()
    if n=='END OF INPUT':
        break
    
    n=list(n)
    m=[]
    sum=0
    for i in range(len(n)):
        if n[i]==' ':
            m.append(sum)
            sum=0
        else:
            sum+=1
    print(*m,sum,sep='')

Python: while True:
    s = str(input())
    
    if s == 'END OF INPUT':
        break
    
    S = []
    l = s.split(' ')
    S.extend(l)
    m = len(S)
    
    A = []
    for i in range(m):
        L = len(S[i])
        A.append(L)
    
    
    print(*A,sep='')

Python: while True:
    s = input()
    if s == 'END OF INPUT':
        break
    s = s.translate(str.maketrans({' ': ','}))
    s = s.split(',')
    ans = ''
    for i in s:
        ans += str(len(i))
    print(ans)

Python: while 1:
    a=input()
    if a=="END OF INPUT":break
    a=list(map(lambda x: str(len(x)),a.split(" ")))
    print("".join(a))

Python: # -*- coding: utf-8 -*-
"""
Created on Thu Jun  2 13:42:22 2016

"""

while True:
    S = input()
    if S == "END OF INPUT":
        break
    n = 0
    for l in S:
        if l == " ":
            print(n, end="")
            n = 0
        else:
            n += 1
            
    print(n)

Python: while True:
    s = input()
    if s == "END OF INPUT":break
    t = ""
    while True:
        if s[0] == " ":
            while s[0] == " ":
                t += "0"
                s = s[1:]
        else:
            try:
                i = s.index(" ")
                t += str(i)
                s = s[i + 1:]
            except:
                t += str(len(s))
                break
    print(t)

Python: # coding=utf-8

###
### for atcorder program
###

import sys
import math

# math class
class mymath:
    ### pi
    pi = 3.14159265358979323846264338

    ### Prime Number
    def pnum_eratosthenes(self, n):
        ptable = [0 for i in range(n+1)]
        plist = []

        for i in range(2, n+1):
            if ptable[i]==0:
                plist.append(i)
                for j in range(i+i, n+1, i):
                    ptable[j] = 1
        return plist

    ### GCD
    def gcd(self, a, b):
        if b == 0:
            return a
        return self.gcd(b, a%b)

    ### LCM
    def lcm(self, a, b):
        return (a*b)//self.gcd(a,b)

    ### Mat Multiplication
    def mul(self, A, B):
        ans = []
        for a in A:
            c = 0
            for j, row in enumerate(a):
                c += row*B[j]
            ans.append(c)
        return ans

mymath = mymath()

### output class
class output:
    ### list
    def list(self, l):
        l = list(l)
        #print(" ", end="")
        for i, num in enumerate(l):
            print(num, end="")
            if i != len(l)-1:
                print(" ", end="")
        print()

output = output()

### input sample
#i = input()
#N = int(input())
#A, B, C = [x for x in input().split()]
#N, K = [int(x) for x in input().split()]
#inlist = [int(w) for w in input().split()]

#R = float(input())
#A.append(list(map(int,input().split())))

#for line in sys.stdin.readlines():
#    x, y = [int(temp) for temp in line.split()]

#abc list
#abc = [chr(ord('a') + i) for i in range(26)]

### output sample
#print("{0} {1} {2:.5f}".format(A//B, A%B, A/B))
#print("{0:.6f} {1:.6f}".format(R*R*math.pi,R*2*math.pi))
#print(" {}".format(i), end="")

def get_input():
    N = []
    while True:
        try:
            N.append(input())
            #N.append(int(input()))
            #N.append(float(input()))
        except EOFError:
            break
    return N

def conv(s):
    num = 3
    if s == 'A':
        num = 0
    elif s == 'B':
        num = 1
    elif s == 'AB':
        num = 2
    return num

N = get_input()

for row in N[:-1]:
    PI = [x for x in row.split(' ')]
    for i in PI:
        print(len(i), end='')
    print()

Python: import sys
sys.setrecursionlimit(10**6)
def main():
    s = input()
    if s == "END OF INPUT":
        return False
    if s[0] == " ":
        s[0] = "."
    for _ in range(100):
        s = s.replace("  ", " . ")
    lst = s.split()
    ans = []
    for i in lst:
        if i == ".":
            ans += [0]
        else:
            ans += [len(i)]
    print("".join(map(str, ans)))
    return True

while main():
    pass

Python: while True:
    i = input()
    if i == "END OF INPUT":
        break
    print("".join(map(str, [0 if x == '' else len(x) for x in i.split(' ')])))

Python: while True:
    text = input()
    if text == 'END OF INPUT':
        break
    text = list(text.split(' '))
    answer = []
    for i in range(len(text)):
        answer.append(str(len(text[i])))
    print("".join(answer))

Python: while True:
    word = (input())
    if word == 'END OF INPUT': break
    ans = 0
    for i in word: 
        if ' ' == i:
            print(ans,end='')
            ans = 0
        else: ans += 1
    print(ans)

Python: while True:
    retu=input()
    if retu=="END OF INPUT":
        break
    
    moji=retu.split(" ")
    
    n=len(moji)
    
    for i in range(n):
        k=len(moji[i])
        print(k, end="")
    
    print()

Python: import re

while True:
    a = input()
    
    if a == "END OF INPUT":
        break
    
    a = re.split('[ ]',a)



    ans = []

    for i in a:
       ans.append(len(i))
   
    ans = [str(i) for i in ans]
    ans = "".join(ans)
    print(ans)

Python: while True:
    dataset = input().split()
    if dataset == ["END", "OF", "INPUT"]: break
    print(''.join(map(str, [len(d) for d in dataset])))

Python: while True:
   x = input()
   if x=='END OF INPUT':
      break
   x = x.split(' ')
   for i in range(len(x)):
      print(len(x[i]), end='')
   print()

Python: while True:
    x=input()
    if x=='END OF INPUT':
        break
    lst=x.split(' ')
    a=[]
    for i in range(len(lst)):
        a.append(len(lst[i]))
    print(*a,sep='')