Go: package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

func configure(scanner *bufio.Scanner) {
	// scanner.Split(bufio.ScanWords)
	scanner.Buffer(make([]byte, 1000005), 1000005)
}
func getNextString(scanner *bufio.Scanner) string {
	scanned := scanner.Scan()
	if !scanned {
		panic("scan failed")
	}
	return scanner.Text()
}
func getNextInt(scanner *bufio.Scanner) int {
	i, _ := strconv.Atoi(getNextString(scanner))
	return i
}
func getNextInt64(scanner *bufio.Scanner) int64 {
	i, _ := strconv.ParseInt(getNextString(scanner), 10, 64)
	return i
}
func getNextFloat64(scanner *bufio.Scanner) float64 {
	i, _ := strconv.ParseFloat(getNextString(scanner), 64)
	return i
}
func main() {
	fp := os.Stdin
	wfp := os.Stdout
	extra := 0
	if os.Getenv("I") == "IronMan" {
		fp, _ = os.Open(os.Getenv("END_GAME"))
		extra = 100
	}
	scanner := bufio.NewScanner(fp)
	configure(scanner)
	writer := bufio.NewWriter(wfp)
	defer func() {
		r := recover()
		if r != nil {
			fmt.Fprintln(writer, r)
		}
		writer.Flush()
	}()
	solve(scanner, writer)
	for i := 0; i < extra; i++ {
		fmt.Fprintln(writer, "-----------------------------------")
		solve(scanner, writer)
	}
}
func solve(scanner *bufio.Scanner, writer *bufio.Writer) {
	for s := getNextString(scanner); s != "END OF INPUT"; s = getNextString(scanner) {
		ss := strings.Split(s, " ")
		for i := 0; i < len(ss); i++ {
			fmt.Fprint(writer, len(ss[i]))
		}
		fmt.Fprintln(writer, "")
	}
}

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

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

using namespace std;

int main() {
	int pos, start;
	string input, tmp;

	while (true) {
		getline(cin, input);
		if (input == "END OF INPUT") {
			break;
		}
//		cout << input << "_out" << endl;
		start = 0;
		pos = input.find(" ", start);
		while (pos != string::npos) {
			tmp = input.substr(start, pos - start);
			//cout << "tmp:" << tmp << endl;
			cout << tmp.size();
			start = pos + 1;
			while (input[start] == ' ') {
				++start;
			}
			while (start - pos != 1) {
				cout << "0";
				++pos;
			}
			pos = input.find(" ", start);
		}
		tmp = input.substr(start, pos - start);
		cout << tmp.size() << endl;
	}
	
	return 0;
}

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

using namespace std;

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

int main()
{
	solve();
	return(0);
}