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<stdio.h>
#include<stdlib.h>
#include<string.h>


int main(){
	char ss[1000],out[1000],syuu[16];
	int i,j,a;
	strcpy(syuu,"END OF INPUT");
	syuu[12]=13;
	syuu[13]=10;
	syuu[14]=0;
	
	while(fgets(ss,sizeof(ss),stdin)!=NULL){
				
		
		if(0==strcmp(ss,syuu))break;
		
		i=-1;
		j=0;

		while(1){
			if(ss[i]=='\n')break;
			++i;
			for(a=0;;a++){
				if(ss[a+i]==' ' || ss[a+i]=='\n')break;
			}
			
			out[j]=a+'0';
			out[j+1]='\0';
			if(ss[a+i]=='\n')--out[j];
			++j;
			i=i+a;
		}
		printf("%s\n",out);
	}
	return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
int main(){
	
	cin.tie( 0 );
	ios::sync_with_stdio( false );
    
	for(int n; cin >> n, n != 0;){        

        	int MAX = INT_MIN ,MIN = INT_MAX;
        	vector<int> vc(n);
        
        	for(int i=0; i<n; i++){
            		cin >> vc[i];
            		MAX = max(MAX, vc[i]);
            		MIN = min(MIN, vc[i]);
        	}
        	auto res = (accumulate(vc.begin(), vc.end(), 0)) - (MAX + MIN);
        	cout << res / (n-2) << endl;
    	}
    return 0;
}

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

int main(){
	string s,t;
	while(getline(cin,s),s!="END OF INPUT"){
		while(~s.find("  "))s.replace(s.find("  "),2," 9=_=9 ");
		stringstream ss(s);
		while(ss>>t)cout << (t=="9=_=9"?0:t.length());
		cout << endl;
	}
}

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

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

using namespace std;

int main()
{
  string str("END OF INPUT");
  int size;

  while(1){
    size = 0;
    string v;
    getline(cin,v);

    if(v == str){
      break;
    }

    for(char e : v){
      if(e == ' '){
        cout<<size;
        size = 0;
      } 
      else{
        size++;
      } 
    }
    cout<<size<<endl;
  }
  return 0;
}

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

int main() {
  std::ios::sync_with_stdio(false);
  cout.tie(0);
  cin.tie(0);
  while (true) {
    string Str;
    getline(cin,Str);
    if (Str=="END OF INPUT") {
      break;
    }
    if (Str=="") {
      cout<<0<<endl;
      continue;
    }
    int wordcnt=0;
    for (int i=0; i<Str.length(); i++) {
      if (Str[i]!=' ') {
	wordcnt++;
      }
      if (Str[i]==' ') {
	cout<<wordcnt<<flush;
	wordcnt=0;
      }
    }
    cout<<wordcnt<<endl;
  }
  return 0;
}

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

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

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

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,j) FOR(i,0,j)
#define mp std::make_pair

const int INF = 1 << 24;
const int dx[8] = {0, 0, 1, -1, 1, 1, -1, -1}, dy[8] = {1, -1, 0, 0, 1, -1, 1, -1};

typedef unsigned long long ull;
typedef std::pair<int,int> P;

int main(){
    std::string s;
    while(std::getline(std::cin, s), s != "END OF INPUT"){
        s += " ";
        int prev_pos = 0, pos = 0;
        while(pos = s.find(" ", pos), pos != std::string::npos){
            printf("%d", pos - prev_pos);
            prev_pos = pos + 1;
            pos += 1;
        }
        puts("");
    }
}

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);
		if(s=="END OF INPUT")break;
		ans="";
		int cnt=0;
		rep(i,s.size()+1){
			if(s[i]==' ' || s[i]=='\0'){
				ans+=(char)(i-cnt+'0');
				cnt=i+1;
			}
		}
		cout<<ans<<endl;
	}
	return 0;
}

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

using namespace std;

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

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

const string eof = "END OF INPUT";
typedef vector <string> VS;
typedef vector <int> VI;
typedef istringstream ISS;

int main() {
    string line;
    while ( getline( cin, line ) ) {
        if ( line == eof ) break;
        string s = line;
        int n = s.size();
        n--;
        int cnt = 0;
        VI L;
        for ( int i = 0; i < n; ++ i ) {
            if ( s[i] == ' ' ) {
                if ( i + 1 < n && s[i+1] == ' ' ) {
                    L.push_back( 0 );
                    i ++;
                } else if ( cnt > 0 ) {
                    L.push_back( cnt );
                }
                cnt = 0;
            } else {
                cnt ++;
            }
        }
        if ( cnt > 0 ) L.push_back( cnt );
        for ( VI::iterator it_i = L.begin(); it_i != L.end(); ++ it_i ) {
            cout << *it_i;
        }
        cout << endl;
    }
	return 0;
}

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

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

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

int main() {
  string str, s;
  
  while(getline(cin,str)) {
    if(str == "END OF INPUT") break;
    stringstream ss(str);
    while(ss >> s) {
      cout << s.size();
    }
    cout << endl;
  }
  
  return 0;
}

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+" ";
		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;
	}
}