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<vector>
#include<string>
using namespace std;

vector<vector<int>> ans;
int main(){
  string str;
  while(getline(cin, str),str != "END OF INPUT"){
    vector<int> num;
    int count =0 ;
    for(int i=0; i<str.size(); ++i){
      //cout << count << endl;
      if(str[i]==' '){
	//cout << "tnp" << endl;
	num.push_back(count);
	count = 0;
      }else{
	++count;
      }
    }
    num.push_back(count);
    ans.push_back(num);
  }
  for(auto i:ans){
    for(auto j:i){
      cout << j;
    }
    cout << 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 cont = 0;
		for (int i=0; str[i] != '\0'; i++)
		{
			if(str[i] == ' ') {
				cout << cont;
				if(cont == 0)	i++;
				cont = 0;
			}else {
				cont++;
			}
		}

		cout << cont << endl;
	}

	return 0;
}

C++: #include <iostream>
#include <vector>
#include <stdio.h>
using namespace std;
const string FIN = "END OF INPUT";
int main(){
  while(1){
    string s;
    getline(cin,s);
    if(s == FIN)break;
    int cnt = 0;
    for(int i = 0;i < s.size();i++){
      if(s[i] == ' '){
	cout << cnt;
	cnt = 0;
      }else{
	cnt++;
      }
    }
    cout << cnt <<endl;
  }
  return 0;
}

C++: #include<iostream>
#include<iomanip>
#include<algorithm>
#include<array>
#include<bitset>
#include<cassert>
#include<cctype>
#include<cmath>
#include<cstdio>
#include<cstring>
#include<functional>
#include<limits>
#include<list>
#include<map>
#include<numeric>
#include<set>
#include<stack>
#include<string>
#include<sstream>
#include<unordered_map>
#include<queue>
#include<vector>
using namespace std;

using ll = long long;
using ull = unsigned long long;
using pii = pair<int, int>;

#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define all(a) (a).begin(),(a).end()
#define dump(o) {cerr<<#o<<" "<<o<<endl;}
#define dumpc(o) {cerr<<#o; for(auto &e:(o))cerr<<" "<<e;cerr<<endl;}
#define INF 0x3f3f3f3f
#define INFL 0x3f3f3f3f3f3f3f3fLL
const int MOD = 1e9 + 7;

vector<string> split(const string& input, char delimiter)
{
	istringstream stream(input);
	string field;
	vector<string> ret;
	while (getline(stream, field, delimiter))
		ret.push_back(field);
	return ret;
}

signed main() {
	for (string s; getline(cin, s) && s != "END OF INPUT";) {
		vector<string> t(split(s, ' '));
		rep(i, 0, t.size())cout << t[i].size();
		cout << endl;
	}
	return 0;
}

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

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

	int cnt = 0;
	for ( int i = 0; i < line.size(); i++ ){
	    if ( line[i] == ' ' ) {
		cout << cnt; cnt = 0;
	    } else {
		cnt++;
	    }
	}
	cout << cnt << endl;

    }
}

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

int main() {
  string s0;
  while(getline(cin, s0) && s0!="END OF INPUT") {
    string s = s0;
    int p = s.find(" ");
    while(p!=-1) {
      cout << p;
      s = s.substr(p+1);
      p = s.find(" ");
    }
    // if (!isalpha(s0[s0.length()-1]))
    //cout << 0<<"'";
    cout << s.length();
    cout << endl;
  }
}

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

using namespace std;



int main() {
	string s;
	while (cin >> s) {
		if (s == "END") {
			cin >> s;
			if (s == "OF") {
				cin >> s;
				if (s == "INPUT")
					break;
				else
					cout << "35";
			}
			else cout << "3";
		}
		cout << s.size();
	}
	cout << 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;
		bool f = 1;
		int co = 0;
		REP(i, s.size()){
			if (s[i] == ' '){
				if (f){
					v.push_back(co);
					co = 0;
					f = 0;
				}
			}
			else{
				f = 1;
				co++;
			}
		}
		if (co > 0)v.push_back(co);
		REP(i, v.size())cout << v[i];
		cout << endl;
		v.clear();
	}
}

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{
				cout << len;
				len = 0;
			}
		}
		cout << len << endl;
	}
	return 0;
}

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

int main(){
	string s,t;
	while(getline(cin,s),s!="END OF INPUT"){
		stringstream ss(s);
		while(ss>>t)cout << t.length();
		cout << endl;
	}
}

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

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

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

using namespace std;

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