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 <bits/stdc++.h>
using namespace std;

#define iota(i,n,b,s) for(int i=int(b);i!=int((b)+(s)*(n));i+=(s))
#define range(i,n,m) iota(i,(((n)>(m))?((n)-(m)+1):((m)-(n)+1)),(n),((n)>(m)?-1:1))
#define rep(i,n) iota(i,(n),0,1)

#define INF (1e9)
#define EPS (1e-9)
#define cons(a,b) (make_pair(a,b))
#define car(a) (a.first)
#define cdr(a) (a.second)
#define cadr(a) (car(cdr(a)))
#define cddr(a) (cdr(cdr(a)))
#define all(a) a.begin(), a.end()
#define trace(var) cerr<<">>> "<<#var<<" = "<<var<<endl;

typedef long long Integer;
typedef double Real;

template<class S, class T>
ostream& operator<<(ostream& os, pair<S,T> p) {
  os << '(' << car(p) << ", " << cdr(p) << ')';
  return os;
}

template<class T>
ostream& operator<<(ostream& os, vector<T> v) {
  os << v[0];
  for (int i=1, len=v.size(); i<len; ++i) os << ' ' << v[i];
  return os;
}

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

vector<string> sp(string s) {
  vector<string>r;
  int idx=0;
  rep (i, s.size()) {
    if (s[i] == ' ') {
      r.push_back(s.substr(idx, i - idx));
      idx = i + 1;
    }
  }
  r.push_back(s.substr(idx,s.size()));
  return r;
}

int main() {

  for (string s;;) {
    getline(cin, s);
    if (s == "END OF INPUT") break;
    auto v = sp(s);
    for (string w : v) {
      cout << w.size();
    } cout << endl;
  }

  return 0;
}

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

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

C++: #include<iostream>
#include<string>
using namespace std;
int main(void){
  string str,ans;
  for(;;){
    getline(cin,str);
    if(str=="END OF INPUT") break;
    ans.clear();
    for(int i=0;i<str.size();i++){
      if(i==0 && str[i]==' ' || str[i-1]==' ' && str[i]==' ') ans+='0';
      else if(str[i-1]==' ' || i==0){
	char c=0;
	for(int j=i;;j++){
	  if(str[j]==' ' || j==str.size()) break;
	  c++;
	}
	ans+=c+48;
      }
    }
    cout << ans << endl;
  }
}

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

int main(){
  bool flag;
  stringstream ss;
  string str;
  vector<int> ans;
  
  while(1){
    flag=false;
    ans.clear();
  
    getline(cin,str);
    if(str=="END OF INPUT") break;
    
    for(int i=0;i<(int)str.size();i++)
      if(str[i]!=' ') flag=true;
    if(!flag){
      printf("0\n");
      continue;
    }
    
    ss<<str;
    while(1){
      ss>>str;
      if(str=="") break;
      ans.push_back((int)str.size());
      str="";
    }
    
    for(int i=0;i<(int)ans.size();i++)
      printf("%d",ans[i]);
    puts("");
    
    ss.str("");
    ss.clear(stringstream::goodbit);
  }
  return 0;
}

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

using namespace std;

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

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

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

#define loop(i,a,b) for(int i=(a); i<(int)(b); i++)
#define rep(i,b) loop(i,0,b)
#define all(c) (c).begin(), (c).end()
 
typedef vector<int> vi;
typedef vector<vi> vvi;

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

    int cnt = 0;
    for(int i = 0; i < s.size(); i++) {
      char c = s[i];
      if(('a' <= c && c <= 'z') || ('A' <= c && c <= 'Z')) cnt++;
      else {
        cout << cnt;
        cnt = 0;
      }
    }
    cout << cnt << endl;
  }
}

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

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

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

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;
V v;

int main(){
	while (getline(cin, s)){
		if (s == "END OF INPUT")break;
		int co = 0;
		REP(i, s.size()){
			if (s[i] == ' '){
				v.push_back(co);
				co = 0;
			}
			else{
				co++;
			}
		}
		if (co > 0)v.push_back(co);
		REP(i, v.size())cout << v[i];
		cout << endl;
		v.clear();
	}
}

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

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

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

using namespace std;

int main() {
	int count;
	string s;
	while(getline(cin,s))
	{
		if(s=="END OF INPUT")
		break;
		count = 0;
		for(int i=0;i<s.length();i++) {
			count++;
			if(s[i]==' '){
				printf("%d",count-1);
				count = 0;
			}
			if(i==s.length()-1) printf("%d",count);
		}
		printf("\n");
	}
}

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

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

		string ans,sa;
		for (int i = 0;i < s.size();i++) {
			if (s[i] != ' ')sa.push_back(s[i]);
			else {
				if (i < s.size() - 1 && s[i + 1] == ' ') {
					ans.push_back('0');
				}
				else {
					int a = sa.size();
					string sb = to_string(a);
					ans += sb;
					sa.clear();
				}
			}
		}
		int a = sa.size();
		string sb = to_string(a);
		ans += sb;

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