Go: package main

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

func configure(scanner *bufio.Scanner) {
	// scanner.Split(bufio.ScanWords)
	scanner.Buffer(make([]byte, 1000005), 1000005)
}
func getNextString(scanner *bufio.Scanner) string {
	scanned := scanner.Scan()
	if !scanned {
		panic("scan failed")
	}
	return scanner.Text()
}
func getNextInt(scanner *bufio.Scanner) int {
	i, _ := strconv.Atoi(getNextString(scanner))
	return i
}
func getNextInt64(scanner *bufio.Scanner) int64 {
	i, _ := strconv.ParseInt(getNextString(scanner), 10, 64)
	return i
}
func getNextFloat64(scanner *bufio.Scanner) float64 {
	i, _ := strconv.ParseFloat(getNextString(scanner), 64)
	return i
}
func main() {
	fp := os.Stdin
	wfp := os.Stdout
	extra := 0
	if os.Getenv("I") == "IronMan" {
		fp, _ = os.Open(os.Getenv("END_GAME"))
		extra = 100
	}
	scanner := bufio.NewScanner(fp)
	configure(scanner)
	writer := bufio.NewWriter(wfp)
	defer func() {
		r := recover()
		if r != nil {
			fmt.Fprintln(writer, r)
		}
		writer.Flush()
	}()
	solve(scanner, writer)
	for i := 0; i < extra; i++ {
		fmt.Fprintln(writer, "-----------------------------------")
		solve(scanner, writer)
	}
}
func solve(scanner *bufio.Scanner, writer *bufio.Writer) {
	for s := getNextString(scanner); s != "END OF INPUT"; s = getNextString(scanner) {
		ss := strings.Split(s, " ")
		for i := 0; i < len(ss); i++ {
			fmt.Fprint(writer, len(ss[i]))
		}
		fmt.Fprintln(writer, "")
	}
}

C++: // clang-format off
#include <bits/stdc++.h>
#define int long long
#define main signed main()
// #define main int main()
#define loop(i, a, n) for (int i = (a); i < (n); i++)
#define rep(i, n) loop(i, 0, n)
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define prec(n) fixed << setprecision(n)
#define stlice(from, to) substr(from, (to) - (from) + 1)
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
using namespace std;
using pii = pair<int, int>;
using vi = vector<int>;
using vd = vector<double>;
using vc = vector<char>;
using vb = vector<bool>;
using vs = vector<string>;
using vpii = vector<pii>;
using vvi = vector<vi>;
using vvb = vector<vb>;
using vvpii = vector<vpii>;
template<typename A> using fn = function<A>;
constexpr int INF = sizeof(int) == sizeof(long long) ? 1000000000000000000LL : 1000000000;
constexpr int MOD = 1000000007;
constexpr double PI = acos(-1);
template<typename A, typename B> bool cmin(A &a, const B &b) { return a > b ? (a = b, true) : false; }
template<typename A, typename B> bool cmax(A &a, const B &b) { return a < b ? (a = b, true) : false; }
constexpr bool odd(const int &n) { return n & 1; }
constexpr bool even(const int &n) { return !odd(n); }
void solve();
main { solve(); return 0; }
// clang-format on

vector<string> split(const string &s, const char &delim) {
  istringstream ss(s);
  string got;
  vector<string> v;
  while (getline(ss, got, delim)) v.pb(got);
  return v;
}

void solve() {
  string s;
  while (getline(cin, s), s != "END OF INPUT") {
    vs v = split(s, ' ');
    for (auto &x : v) cout << x.size();
    cout << endl;
  }
}

C++: #include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <bitset>

#define rep(i, n) for(int i = 0; i < (n); i++)
#define FOR(i, a, b) for(int i = (a); i < (b); i++)
#define all(v) (v).begin(), (v).end()
#define rev(s) (s).rbegin(), (s).rend()
#define MP make_pair
#define X first
#define Y second

using namespace std;

typedef long long ll;
typedef pair<int, int> P;
typedef pair<double, double> dP;

const int INF = 100000000;
const double EPS = 1e-10;

int d[100001];
int dsum[100001];

int main(){
	string s;
	while(getline(cin, s), s != "END OF INPUT"){
		int cnt = 0;
		rep(i, s.size()+1){
			if(i == s.size()){
				cout << cnt;
				break;
			}
			if(s[i] == ' '){
				cout << cnt;
				cnt = 0;
			}else{
				cnt++;
			}
		}
		cout << endl;
	}


	return 0;
}

C++: #include <iostream>
#include <string>
using namespace std;

int main(){
	string s;
	for(;getline(cin,s),s!="END OF INPUT";){
		int n=0,i;
		for(i=0;i<s.size();i++){
			(i==s.size()-1)?
				cout<<n+1<<endl,0
			:
				(s[i]==' ')?
					(cout<<n),n=0
				:
					n++;
		}
	}
}

C++: // AOJ 1042
#include<iostream>
#include<sstream>
#include<string>

int main()
{
	std::string s;
	while( std::getline( std::cin, s ), s != "END OF INPUT" )
	{
		std::istringstream iss( s );
		std::string t;
		while( iss >> t )
			printf( "%d", t.size() );
		
		puts("");
	}

	return 0;
}

C++: #include <cstdio>
#include <cstdlib>
#include <vector>
#include <iostream>
#include <string>
using namespace std;

int main(int argc, char *argv[]) {
	while (true) {
		string buf;
		getline(cin, buf);
		// end
		if (buf == "END OF INPUT") break;
		
		buf[buf.size()]=' ';
		for (int i = 0; i < buf.size(); i++) {
			for (int j = 0; j < buf.size(); j++) {
				if (buf[i+j] == ' ') {
					printf("%d", j);
					i+=j;
					break;
				}
			}
		}
		printf("\n");
	}
	return 0;
}

C++: // AOJ 1042
#include<iostream>
#include<sstream>
#include<string>
#define repi(i,a,b) for( int i = (a); i < (b); ++i )

int main()
{
	std::string s;
	while( std::getline( std::cin, s ), s != "END OF INPUT" )
	{
		std::istringstream iss( s );

		int prv = 0;
		repi( i, 1, s.size() )
		{
			if( s[i] == ' ' )
			{
				std::cout << i-prv;
				if( i == prv )
				{
					while( s[i] == ' ' )
						++i;
					prv = i;
				}
				else
					prv = i+1;
			}
		}

		if( prv < s.size()-1 )
			std::cout << s.size()-prv;

		std::cout << std::endl;
	}

	return 0;
}

C++: #include<vector>
#include<list>
#include<algorithm>
#include<iostream>
#include<string>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
using namespace std;
int main(){
  int i,j;
  char c[1024];
  string s;
  c[0]=' ';
  for(;;){
    fgets(c+1,1023,stdin);
    if(strcmp(c+1,"END OF INPUT\n")==0)
      break;
    for(i=0;c[i]!='\n';i=j){
      for(j=i+1;c[j]!='\n'&&c[j]!=' ';j++);
      cout<<j-i-1;
    }
    cout<<endl;
  }
  return 0;
}

C++: #include <iostream>
using namespace std;
int main(){
  string s;
  while( true ){
    getline(cin,s);
    if( s=="END OF INPUT" )
      break;
    for( int i=0,n=0,len=s.length()+1;i<len;i++ ){
      if( i==len-1 || s[i]==' '){
	cout << n ;
	n=0;
      }else
	n++;
    }
    cout << endl;
  }
}

C++: #include <iostream>
#include <vector>
#include <algorithm>
#include <string>

using namespace std;

int main(){

	string str;
	while(1){
		getline(cin,str);
		if(str=="END OF INPUT"){
			break;
		}
		int cnt=0;
		for(int i = 0; i < str.size(); i++){
			if(i == str.size()-1)
				cout << cnt+1 << endl;
			else if(str[i]==' '){
				cout << cnt;
				cnt=0;
			}
			else{
				cnt++;
			}
		}

	}

	return 0;
}

C++: #include<iostream>
#include<string>
int main(){std::string s;while(1){std::getline(cin,s);if(s=="END OF INPUT")break;int t=0;for(int i=0;i<s.length();i++)if(s.at(i)==' ')std::cout<<t,t=0;else t++;std::cout<<t<<"\n";}}

C++: #include<iostream>
using namespace std;

int main(){
    string s;
    while(getline(cin, s)){
        if(s == "END OF INPUT") break;
        int cnt = 0;
        for(int i = 0; i < s.length(); i++){
            if(s[i] != ' ') cnt++;
            else            cout << cnt, cnt = 0;
        }
        cout << cnt << endl;
    }   
    return 0; 
}

C++: #include<iostream>
#include<string>
#include<algorithm>

using namespace std;

int main(){
    string sentence;
    int count;

    while(getline(cin,sentence)){
        if(sentence== "END OF INPUT") break;
        else{
            count = 0;
            for(int i=0;i!=sentence.size();i++){
                if(sentence[i]!= ' ') count++;
                else{
                    cout<<count;
                    count = 0;
                }
            }
            cout<<count<<endl;
        }
    }
    return 0;
}