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 <vector>
#include <string>
#include <sstream> 
#include <algorithm>

using namespace std;

string solve(string str) {
    string ans;

    // split
    vector<string> results;    
    stringstream ss(str);
    string buffer;
    char sep = ' ';
    while( std::getline(ss, buffer, sep) ) {
        results.push_back(buffer);
    }

    const int size = results.size();
    for (int i = 0; i < size; ++i) {   
        string tmp = to_string(results[i].length());
        ans += tmp;
    }

    return ans;
}

int main(int argc, char const *argv[]) {
    string str;
    const string end("END OF INPUT");

    while (getline(cin, str), str != end) {
        cout<<solve(str)<<endl;
    }
    return 0;
}

C++: #include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<sstream>
#include<vector>
using namespace std;

int main(){
  string str;
  stringstream ss;
  vector<vector<int> > ans(100);
  int count=0;
  
  while(1){
    getline(cin,str);
    if(str=="END OF INPUT") break;
    
    ss<<str;
    while(1){
      str="";
      
      ss>>str;
      if(str=="") break;
      ans[count].push_back((int)str.length());
    }
    ss.str("");
    ss.clear(stringstream::goodbit);
    count++;
  }
  for(int i=0;i<count;i++){
    vector<int>::iterator it=ans[i].begin();
    while(it!=ans[i].end()){
      cout<<*it;
      it++;
    }
    puts("");
  }
  /*または
  for(int i=0;i<count;i++){
    for(int l=0;l<(int)ans[i].size();l++){
      printf("%d",ans[i][l]);
    }
    puts("");
  }
  */
  return 0;
}

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

using namespace std;

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

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

using namespace std;

#define FOR(i,a,b) for(long long i=(a);i<(b);i++)
#define REP(i,N) for(long long i=0;i<(N);i++)
#define ALL(s) (s).begin(),(s).end()
#define fi first
#define se second

#define PI acos(-1.0)
#define INF 1000000007
#define EPS 1e-10

typedef long long ll;
typedef pair<ll, ll> P;
typedef pair<double, double> PD;
typedef pair<string, ll> PS;
typedef vector<ll> V;
typedef pair<P, char> PC;

string s;

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

C++: #include<iostream>
#include<algorithm>
#include<set>
#include<map>
#include<vector>
#include<queue>
#include<cstring>
#include<cmath>
#include<cstdio>
#include<cstdlib>
using namespace std;
#define REP(i,a,n) for(int i = a ; i < n ; i++)
#define rep(i,n) REP(i,0,n)

typedef long long ll;

int main(){
  string s;

  while(1){
    getline(cin,s);
    if(s == "END OF INPUT") break;
    int before = 0;
    rep(i,s.length()+1){
      if(i == s.length() || s[i] == ' '){
        cout<<i-before;
        before = i+1;
      }
    }
    cout<<endl;
  }
}

C++: #include <iostream>
using namespace std;
int main(){
	string s;
	while(getline(cin,s)){
		string ans="";
		if(s=="END OF INPUT")break;
		if(s==""){ans="0";break;}
		bool backsp = true;
		int count = 0;
		for(int i=0;i<s.size();++i){
			if(('A'<=s[i]&&s[i]<='Z')||('a'<=s[i]&&s[i]<='z')){
				if(backsp){
					backsp=false;
					count=1;
				}else{
					count++;
				}
				if(i==s.size()-1)ans+=('0'+count);
			}else if(s[i]==0x20){
				if(!backsp){
					backsp=true;
					ans+=('0'+count);
				}else{
					ans+="0";
				}
			}
		}
		cout<<ans<<"\n";
	}
}

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

using namespace std;

int main()
{
  string line;

  while (1) {
    getline(cin, line);
    if (line == "END OF INPUT") return 0;
    string word;
    stringstream ss(line);
    char delim = ' ';
    while (getline(ss, word, delim)) {
      cout << word.length();
    }
    cout << endl;
  }
}

C++: #include <iostream>
#include <string>
#include <sstream>
#include <algorithm>
#include <vector>
#include <utility>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <ctime>
#include <cstdlib>
#include <map>
#include <set>
#include <stack>
#include <queue>
 
using namespace std;
 
#define pb(n)	push_back(n)
#define mp(n,m) make_pair(n,m)
#define fi 	first
#define se 	second
#define all(r) (r).begin(),(r).end()
 
#define REP(i,s,e)	for(ll i=(s); i<(e); i++)
#define rep(i,n)	REP(i,0,n)
#define REPE(i,s,e)	for(ll i=s; i>e; i--)
#define repe(i,n)	REPE(i,n,-1)
 
 
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
 
typedef vector<vi> vvi;
 
const int IMAX=((1<<30)-1)*2+1;
const int INF=100000000;
const double EPS=1e-10;
//int mod=1000000007


vector<string> split(const string &s, char c = ' '){
	vector<string> ret;
	stringstream ss(s);
	string t;
	while(getline(ss,t,c)){
		ret.pb(t);
	}
	return ret;
}



int main(){
	string s;
	while(getline(cin,s)){
		if(s == "END OF INPUT") break;
		vector<string> v = split(s);
		for(int i = 0; i < v.size(); i++) cout<<v[i].size();
		cout<<endl;
	}
}

C++: #include<stdio.h>
#include<string.h>

int main(void){
	char input[1024];
	char END[]={"END OF INPUT"};
	int n,n2;
	int kuhaku=1;
	int cnt=0,i;

	while(1){
		fgets(input,sizeof(input),stdin);
		n=strlen(input);
		n2=strlen(END);
		for(i=0;i<n2;i++){//I¹ð
			if(input[i]==END[i]){
				cnt++;	
			}
			if(cnt>=12){
				return 0;
			}
		}

		cnt=0;
		for(i=0;i<n;i++){
			cnt++;
			if(input[i]==' '){
				if(input[i+1]!=' '){
					printf("%d",cnt);
					cnt=0;
				}else{
					kuhaku++;
					if(kuhaku>=3 && input[i+1]!=' '){
						printf("%d",0);
						kuhaku=0;
					}
				}
			}
		}
	}
}

C++: #include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <cstring>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <fstream>
#include <complex>
#include <stack>
#include <queue>

using namespace std;
typedef long long LL;
typedef pair<int, int> PII;
static const double EPS = 1e-5;

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

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

C++: #include<iostream>

#define FOR(i,c) for(__typeof((c).begin()) i=(c).begin(); i!=(c).end(); i++)

using namespace std;

int main(){
  string buff;

  while(getline(cin, buff), buff != "END OF INPUT"){
    int cnt = 0;
    FOR(it, buff){
      if(*it == ' '){
	cout << cnt;
	cnt = 0;
      }else{
	++cnt;
      }
    }
    if(cnt) cout << cnt;
    cout << endl;
  }

  return 0;
}