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 <string>

using namespace std;

int main(){
  string str;
  while(getline(cin, str)){
    if(str == "END OF INPUT") break;
    int idx = 0;
    while(idx < str.size()){
      int cnt = 0;
      while(idx < str.size() && str[idx++]!=' ') cnt++;
      cout << cnt;
    }
    cout << endl;
  }
}

C++: #include <functional>
#include <algorithm>
#include <iostream>
#include <numeric>
#include <iomanip>
#include <utility>
#include <cstdlib>
#include <sstream>
#include <bitset>
#include <vector>
#include <cstdio>
#include <ctime>
#include <queue>
#include <deque>
#include <cmath>
#include <stack>
#include <list>
#include <map>
#include <set>

using namespace std;

typedef vector<int> vi;
typedef pair<int,int> pii;
typedef long long ll;

#define dump(x)  cerr << #x << " = " << (x) << endl
#define rep(i,n) for(int i=0;i<(n);i++)
#define all(a)  (a).begin(),(a).end()
#define pb push_back

int data[100]={};
int mini;
int n;
int SUM;



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

    return 0;
}

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

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

C++: #include <iostream>
#include <complex>
#include <sstream>
#include <string>
#include <algorithm>
#include <deque>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <vector>
#include <set>
#include <limits>
#include <cstdio>
#include <cctype>
#include <cmath>
#include <cstring>
#include <cstdlib>
#include <ctime>
using namespace std;
#define REP(i, j) for(int i = 0; i < (int)(j); ++i)
#define FOR(i, j, k) for(int i = (int)(j); i < (int)(k); ++i)
#define SORT(v) sort((v).begin(), (v).end())
#define REVERSE(v) reverse((v).begin(), (v).end())
typedef complex<double> P;

vector<string> split(string &str, char delim){
  stringstream ss(str);
  string tmp;
  vector<string> res;
  while(getline(ss, tmp, delim)) res.push_back(tmp);
  return res;
}

int main() {
  string s;
  while(getline(cin, s) && s != "END OF INPUT"){
    vector<string> ws = split(s, ' ');
    REP(i, ws.size()) cout <<ws[i].length();
    cout <<endl;
  }
  return 0;
}

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

#define REP(i,a,n) for(int i=(a); i<(int)(n); i++)
#define rep(i,n) REP(i,0,n)
#define EPS 1e-9

int main(){
	string in;
	while(getline(cin,in),in!="END OF INPUT"){
		int cnt;
		for(int i=0; i<in.size();i++){
			cnt = 0;
			for(;i<in.size() && in[i]!=' ';i++,cnt++);
			if( i==in.size() )cnt--;
			printf("%d",cnt);
		}
		puts("");
	}
	return 0;
}

C++: #include <iostream>
#include <vector>
#include <cmath>
#include <string.h>
using namespace std;

int main() {
	char s[1000];
	while(true) {
		fgets(s, 1000, stdin);

		if(s[strlen(s)-1] == '\n') {
			s[strlen(s)-1] = '\0';
		}
		if(s[strlen(s)-1] == '\r') {
			s[strlen(s)-1] = '\0';
		}
		if (strcmp(s, "END OF INPUT") == 0) {
			break;
		}
		int len = 0;
		for (int i = 0; i < (int)strlen(s); i++) {
			if(s[i] != ' ') {
				len++;
			}
			else if(len != 0) {
				cout << len;
				len = 0;
			}
		}
		cout << len-1 << endl;
	}
	return 0;
}

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

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

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

int main()
{
	string str;
	while(1){
		getline(cin, str);
		if(str == "END OF INPUT")
			break;
		int n=0;
		int i;
		for(i=0;i<str.size();i++){
			if(str[i] == ' '){
				if(str[i-1]==' '){
					cout << 0;
				}else{
					cout << i-n;
				}
				i++;
				n = i;
			}
		}
		if(str[str.size()-1] == ' '){
			cout << 0 << endl;;
		}
		else{
			cout << i-n << endl;
		}
	}
	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++;
}