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<iostream>
using namespace std;string s;int main(){for(;getline(cin,s),s!="END OF INPUT";){int j,i,m=int(s.size());for(j=i=0;i<m;i++){if(s[i]==' '){cout<<i-j;j=i+1;}}cout<<m-j<<endl;}}

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

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

C++: #include<cstdio>
#include<cstring>
using namespace std;
int main(){
	char s[1000];
	int n,i;
	for(;gets(s),strpbrk(s,"END OF INPUT");)
		for(n=i=0;i<strlen(s);i++)
			i==strlen(s)-1?printf("%d\n",n+1):s[i]==' '?printf("%d",n),n=0:n++;
}

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;
		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 <iostream>
#include <string>

using namespace std;

int main(){
  string str;
  while(getline(ciin, str)){
    if(str == "END OF INPUT") break;
    int idx = 0;
    while(idx < str.size()){
      int cnt = 0;
      while(idx < str.size() && str[idx++]!=' ') cnt++;
      cout << cnt;
    }
    cout << endl;
  }
}

C++: #include <iostream>
#include <string>
#include <algorithm>
#include <set>
#include <vector>
#include <cstring>
#include <climits>
#include <queue>
#include <map>
#include <sstream>
using namespace std;

#define REP(i,a,n) for(int i=(a); i<(int)(n); i++)
#define rep(i,n) REP(i,0,n)
#define EPS 1e-9

int main(){
	string in;
	while(getline(cin,in),in!="END OF INPUT"){
		int cnt;
		for(int i=0; i<in.size();i++){
			cnt = 0;
			for(;i<in.size() && in[i]!=' ';i++,cnt++);
			//if( i==in.size() )cnt--;
			printf("%d",cnt);
		}
		puts("");
	}
	return 0;
}

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

int main()
{
  string s;
  
  while(getline(cin, s)) {
    if(s == "END OF INPUT") break;

    int count = 0;
    vector<int> num;
    for (int i = 0; i < s.size(); i++) {
      if(s[i]==' ') {
	num.push_back(count);
	count = 0;
      }
      else count++;
    }
    num.push_back(count);

    for (int i = 0; i < num.size(); i++) {
      cout << num[i];
    }
    cout << endl;
  }
    
  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;
				prv = i+1;
			}
		}

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

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

	return 0;
}

C++: #include <cstdio>
#include <cstring>
#include <vector>
#include <string>
#include <map>
#include <queue>
#include <stack>
#include <algorithm>

#define rep(i, j) FOR(i, 0, j)
#define FOR(i, j, k) for(int i = j; i < k; ++i)

using namespace std;

int main(){
  char buf[1001];
  char *p;
  while(1){
    fgets(buf, 1001, stdin);
    buf[strlen(buf)-1] = '\0';
    if(strcmp(buf,"END OF INPUT")==0) break;
    printf("%d", strlen(strtok(buf, " ")));
    while((p = strtok(NULL, " ")) != NULL){
      printf("%d", strlen(p));
    }
    puts("");
  }
  return 0;
}

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

C++: #include <cassert>

#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <cwchar>
#include <cwctype>

// C++
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#include <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
//#include <boost/foreach.hpp>
//#include <boost/range/algorithm.hpp>
#define rep(i,j,k) for(int i=(int)j;i<(int)k;i++)
#define ll long long
#define Sort(v) sort(all(v))
#define INF 1e9
#define LINF 1e18
#define END return 0
#define pb push_back
#define se second
#define fi first
#define pb push_back
#define all(v) (v).begin() , (v).end()
#define MP make_pair
#define MOD 1000000007LL
#define int long long
using namespace std;
int day[12]={31,28,31,30,31,30,31,31,30,31,30,31};
// int dx[]={0,1,0,-1};
// int dy[]={1,0,-1,0};
struct edge{int to,cost;};
//typedef pair<int,int> P;

bool isupper(char c){if('A'<=c&&c<='Z')return 1;return 0;}
bool islower(char c){if('a'<=c&&c<='z')return 1;return 0;}
bool isPrime(int x){if(x==1)return 0;if(x==2)return 1;if(x%2==0)return 0;for(int i=3;i*i<=x;i++)if(x%i==0)return 0;return 1;}
bool iskaibun(string s){for(int i=0;i<s.size()/2;i++)if(s[i]!=s[s.size()-i-1])return 0;return 1;}
bool isnumber(char c){return ('0'<=c&&c<='9');}
bool isalpha(char c){return (isupper(c)||islower(c));}
void printvi(vector<int> v){rep(i,0,v.size()){if(i)cout<<" ";cout<<v[i];}cout<<endl;}
void printvil(vector<int> v){rep(i,0,v.size()){cout<<v[i]<<endl;}}
void printvvi(vector<vector<int>> v){
    rep(i,0,v.size()){
        rep(j,0,v[i].size()){
            if(j)cout<<" ";
            cout<<v[i][j];
        }
        cout<<endl;
    }
}
void printvstr(vector<string> v){
    rep(i,0,v.size()){
        cout<<v[i]<<endl;
    }
}

int gcd(int a,int b){
    if(a<b)swap(a,b);
    if(b==0)return a;
    else return gcd(b,a%b);
}

struct S{
    int idx,value;
};

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



    
}
/*
*/