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()
	}

}

C++: #include <map>
#include <set>
#include <list>
#include <cmath>
#include <queue>
#include <stack>
#include <cstdio>
#include <string>
#include <vector>
#include <complex>
#include <cstdlib>
#include <cstring>
#include <numeric>
#include <sstream>
#include <iostream>
#include <algorithm>
#include <functional>

#define mp       make_pair
#define pb       push_back
#define all(x)   (x).begin(),(x).end()
#define rep(i,n) for(int i=0;i<(n);i++)
#define repi(i,a,b) for(int i = (a); i < (b); i++)

using namespace std;

typedef    long long          ll;
typedef    unsigned long long ull;
typedef    vector<bool>       vb;
typedef    vector<int>        vi;
typedef    vector<vb>         vvb;
typedef    vector<vi>         vvi;
typedef    pair<int,int>      pii;

const int INF=1<<29;
const double EPS=1e-9;

const int dx[]={1,0,-1,0},dy[]={0,-1,0,1};

int main(){
	string str;
	while(getline(cin, str)){
		if(str=="END OF INPUT")break;
		stringstream ss;
		ss <<str;

		while(ss>>str){
			int x =str.length();
			cout <<x;
		}
		cout<<endl;
	}
	return 0;
}

C++: #include <iostream>

using namespace std;

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

C++: #include<bits/stdc++.h>
using namespace std;
main(){
  string s;
  while(getline(cin,s),s!="END OF INPUT"){
    for(int i=0,n=0,l=s.size();i<=l;i++){
      if(i==l||s[i]==' '){cout<<n;n=0;}
      else n++;
    }
  }
}

C++: #include<iostream>
#include<string>
using namespace std;
string S, T; int chain;
int main() {
	while (true) {
		getline(cin, S);
		S += ' ';
		T = "";
		if (S == "END OF INPUT") { break; }
		for (int i = 0; i < S.size(); i++) {
			if (S[i] != ' ') { chain++; }
			else { T += to_string(chain); chain = 0; }
		}
		cout << T << endl;
	}
}

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 )
			std::cout << t.size();
		std::cout << std::endl;
	}

	return 0;
}

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

int main(){
  string data;
  int count, p;

  while(1){
    getline(cin,data);
    if(data=="END OF INPUT") break;

    count=0;
    p=0;
    for(int i=0;i<data.size();i++){
      if(data[i]==' '){
	p++;
	if(p==2){
	  //cout << 0;
	}
	cout << count;
	count=0;
	continue;
      }
      count++;
    }
    cout << count;
    cout << endl;
  }
  return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;

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

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

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

C++: #include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <string>
using namespace std;
int main(){
  string str;
  
  while(getline(cin, str)){
    if(str == "END OF INPUT") break;
    
    string ans = "";
    int cnt = 0;
    
    for(int i = 0 ; i < str.size() ; i++){
      if(i == str.size()-1) ans += cnt+1 + '0';
      else if(str[i] != ' ') cnt++;
      else{
	ans += cnt + '0';
	cnt = 0;
      }
    }
    cout << ans << endl;
  }
  return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <string>
#include <sstream>
#include <algorithm>
#include <math.h>
#include <map>
#include <iomanip>
#include <vector>
#include <queue>
#include <set>

#define PI 3.14159265359

#define INF 99999999;

#define rep(i, n) for(int i=0; i<n; i++)
#define REP(n) rep(i, n)

typedef long long ll;

using namespace std;



/*
class LightSwitchingPuzzle
{
public:
	int minFlips(string s)
	{

	}
}
*/


int get_num(string inp)
{
	int ret = 0;
	
	for (int i=0; i<inp.length(); i++)
	{
		if (inp[i] == ' ')
		{
			return ret;
		} else {
			ret++;
		}
	}
}


int main()
{
	string inp;
	int num;
	
	while (getline(cin, inp))
	{
		if (inp == "END OF INPUT") break;
		
		inp += " ";
		
		while (inp != "")
		{
			num = get_num(inp);
			cout << num;
			inp = inp.substr(num+1);
		}
		
		cout << endl;
	}
	
	return 0;
}

C++: #include<bits/stdc++.h>
#define rep(i,n)for(int i=0;i<n;i++)
using namespace std;

int main() {
	string s;
	while (getline(cin, s), s != "END OF INPUT") {
		string res;
		s += ' ';
		replace(s.begin(), s.end(), ' ', '+');
		stringstream ss(s);
		char c;
		int cnt = 0;
		while (ss >> c) {
			if (c == '+') {
				res += to_string(cnt);
				cnt = 0;
			}
			else cnt++;
		}
		cout << res << endl;
	}
}

C++: #include<iostream>
#include<string>
#define loop(i,a,b) for(int i=a;i<b;i++)
#define rep(i,a) loop(i,0,a)
using namespace std;

int main(){
	string s,ans;
	while(1){
		getline(cin,s);
		ans="";
		if(s=="END OF INPUT")break;
		int start=0,end;
		if(s==" "){
			cout<<0<<endl;
		}else{
			for(int i=0;i<s.size();i++){
				if(s[i]==' ' || i==s.size()-1){
					if(i==s.size()-1)end=i+1;
					else end=i;
					if(end-start)ans+=(char)(end-start+'0');
					else{
						if(ans[ans.size()-1]!='0')ans+='0';
					}
					start=end+1;
				}
			}
			cout<<ans<<endl;
		}
	}
	return 0;
}

C++: #include <bits/stdc++.h>

using namespace std;

template <typename T>
using vec1 = vector<T>;

constexpr auto cin2line([] {
    string s;
    getline(cin, s);
    return s;
});

vec1<string> Split(const string& str, char sep)
{
    vec1<string> v;
    stringstream ss(str + sep);
    string       line;
    while (getline(ss, line, sep)) {
        v.push_back(line);
    }
    return v;
}

int main()
{
    while (true) {
        const string S(cin2line());
        if (S == "END OF INPUT") break;
        const auto strs(Split(S, ' '));
        for (const auto& str : strs) {
            cout << str.size();
        }
        cout << endl;
    }
    return 0;
}