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>
#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++){
            cnt++;
            if(str[i] == ' '){
                cout << cnt-1;
                cnt = 0;
            }
            if(str[i] == str[str.size()-1] && i == str.size()-1) cout << cnt << endl;
        }
    }
    
    return 0;
}

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

using namespace std;

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

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

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

C++: #include<cstdio>
#include<iostream>
#include<cstring>
using namespace std;
int main(){
	int h,i,pre,j;

	while(1){
		i=0;
		char s[200];
		while((s[i++]=getchar())!='\n')
		;
		
		if(s[0]=='E'&&s[1]=='N'&&s[2]=='D'&&s[3]==' '&&s[4]=='O'&&s[5]=='F'&&s[6]==' '&&s[7]=='I'&&s[8]=='N'&&s[9]=='P'&&s[10]=='U'&&s[11]=='T')
		break;
		pre=0;
		h=i-1;
		
		for(i=0;i<h+1;i++){
			if(s[i]==' '){
					printf("%d",i-pre);
					pre=i+1;
					if(s[i+1]==' '){
					printf("0");
					i++;
					pre++;
				}
			}
			else if(s[i]=='\n'){
				printf("%d",i-pre);
				break;
			}
		}
		printf("\n");
		
	}
	
	return 0;
}

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++;
    }cout<<endl;
  }
}

C++: #include <iostream>
#include <sstream>
using namespace std;
int main(){
	
	string str;
	while(getline(cin,str)){
		stringstream ss;
		ss<<str;
		if(str.substr(0,12)=="END OF INPUT")break;
		//cout<<"ss:"<<ss.str()<<endl;
		while(ss>>str){
			cout<<str.size();
		}
		cout<<endl;
		//ss.str("");
	}
	return 0;
}

C++: #include <iostream>
#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++){
            cnt++;
            if(str[i] == ' '){
                cout << cnt-1;
                cnt = 0;
            }
            if(str[i] == str[str.size()-1] && i == str.size()-1) cout << cnt << endl;
        }
    }
    
    return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <cassert>
#include <cctype>
#include <complex>
#include <cstdio>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;

string s;

int main(){
	while(getline(cin,s)){
		if(s=="END OF INPUT")return 0;
		int cur=0,l=0;
		while(cur<s.size()){
			if(s[cur++]==' '){cout<<l;l=0;}
			else l++;
		}
		cout<<l<<endl;
	}
}

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

int main(){
	string s;
	while(getline(cin, s)){
		if(s=="END OF INPUT") break;
		int a=0;
		
		while(a<s.size()){
			int count=0;
			while(a<s.size() && s[a] != ' '){
				++a;
				++count;
			}
			printf("%d", count);
			++a;
		}
		printf("\n");
	}
	return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <stdio.h>
#include <cstring>
#include <queue>
#include <stack>
#include <functional>
#include <math.h>
#include <iomanip>
using namespace std;
#define Would
#define you
const int INF = 999999999;
const int MOD = 1e9 + 7;
const double pi = 3.141592653589793238;

int main() {
	string h;
	while (getline(cin, h)) {
		if (h == "END OF INPUT") { break; }
		int mon = 0, cou;
		while (mon < h.length()) {
			cou = 0;
			while (mon < h.length() && h[mon] != ' ') {
				++mon;
				++cou;
			}
			cout << cou;
			++mon;
		}
		cout << endl;
	}
}

C++: #include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;
int main(){
  string s;
  int ans[1000];
  while(getline(cin, s), s != "END OF INPUT"){
    int anscnt = 0;
    for(int i = 0 ; i < s.size() ; i++){
      int cnt = 0;
      anscnt++;
      while(s[i] != ' '){
	cnt++;
      }
      ans[anscnt] = cnt;
    }

    for(int i = 0 ; i < anscnt ; i++){
      cout << ans[i];
    }
    cout << endl;
  }
  return 0;
}

C++: #include <stdio.h>
int main() {char T[9999];int i=0;while (1) {T[i]=getchar();if (T[i]=='\n') {
	if (T[0]=='E' && T[1]=='N' && T[2]=='D' && T[3]==' ' && T[4]=='O' && T[5]=='F' && T[6]==' ' && T[7]=='I' && T[8]=='N' && T[9]=='P' && T[10]=='U' && T[11]=='T') return 0;
	T[i]=' ';for (int j=0,cnt=0;j<=i;j++) if (T[j]!=' ') cnt++;else printf("%d",cnt),cnt=0;puts("");i=0;} else i++;}}

C++: #import<iostream>
#import<string>
using namespace std;int main(){string s;for(int n,i;getline(cin,s),s!="END OF INPUT";)for(n=i=0;i<s.size();i++)i==s.size()-1?cout<<n+1<<"\n",0:s[i]==' '?cout<<n,n=0: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++: #include <iostream>
#include <cstdio>
#include <queue>
#include <stack>
#include <vector>
#include <algorithm>
#include <string>
#include <cstring>
#include <cmath>
#include <complex>
#include <map>
#include <climits>
#include <sstream>
using namespace std;

#define reep(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n) reep((i),0,(n))
#define ALL(v) (v).begin(),(v).end()
#define PB push_back
#define EPS 1e-8
#define F first
#define S second
#define mkp make_pair

static const double PI=6*asin(0.5);
typedef long long ll;
typedef complex<double> CP;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vint;
static const int INF=1<<24;

template <class T>
void initvv(vector<vector<T> > &v,int a,int b, const T  &t = T()){
	v.assign(a,vector<T>(b,t));
}

//v.erase(unique(v.begin(),v.end()),v.end());

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