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

using namespace std;

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

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

C++: #include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <cstring>
#include <climits>
#include <cmath>
#include <cfloat>

#define FOR(i,b,n) for(int i=b;i<n;i++)
#define REP(i,b,n) for(i=b;i<n;i++)
#define CLR(mat) memset(mat, 0, sizeof(mat))

using namespace std;

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

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

#define loop(i,a,b) for(int i=(a);i<int(b);i++)
#define rep(i,b) loop(i,0,b)

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

C++: #include <cstdio>
#include <algorithm>
#include <iostream>
#include <vector>
#include <string.h>
#include <math.h>
#include <time.h>
#include <stdlib.h>
using namespace std;

int main(){
	int n,m;
	char str[10000];
	while(1){
		fgets(str,1000,stdin);
		if(strcmp(str,"END OF INPUT\n")==0) break;
		m=0;
		for(n=0;;n++){
			if(str[n]==' '){
				printf("%d",m);
				m=-1;
			}
			if(str[n]=='\n'){ 
				printf("%d",m);
				break;
			}
			m++;
		}
		printf("\n");
	}
	
	
	return 0;
}

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