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 <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <vector>
#include <string>
#include <map>
#include <queue>
#include <stack>
#include <algorithm>

#define rep(i,j) REP((i), 0, (j))
#define REP(i,j,k) for(int i=(j);(i)<(k);++i)
#define between(a,x,b) ((a)<=(x)&&(x)<=(b))
using namespace std;

int main(){
  char str[1024];
  while(1){
    fgets(str, sizeof(str), stdin);
    str[strlen(str)-1] = ' '; str[strlen(str)] = '\0';
    if(strcmp(str, "END OF INPUT ") == 0) return 0;
    int cnt = 0;
    for(int i = 0; i < strlen(str); ++i){
      if(str[i] == ' '){ printf("%d", cnt); cnt = 0;continue;}
      cnt++;
    }
    puts("");
  }
  return 0;
}

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

using namespace std;

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

C++: #include <iostream>
#include <cstring>
using namespace std;
int main()
{
	char s[257];
	int i, c;
	while (cin.getline(s, sizeof(s)))
	{
		if (!strcmp(s, "END OF INPUT"))
			break;
		for (i = c = 0; i < strlen(s); i++)
		{
			if (s[i] == ' ' && s[i+1] != '\0')
			{
				cout << c;
				c = 0;
			}
			else
				c++;
		}
		cout << c << endl;
	}
}

C++: #include<iostream>
#include<string>
using namespace std;
string S, T; int chain;
int main() {
	while (true) {
		getline(cin, 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 <bits/stdc++.h>
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define RFOR(i,a,b) for(int i=(b) - 1;i>=(a);i--)
#define REP(i,n) for(int i=0;i<(n);i++)
#define RREP(i,n) for(int i=n-1;i>=0;i--)

#define PB push_back
#define MP make_pair
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(),(a).rend()
#define CLR(a) memset(a,0,sizeof(a))
#define SET(a,c) memset(a,c,sizeof(a))

#define DEBUG(x) cout<<"#x"<<": "<<x<<endl

using namespace std;

typedef long long int ll;
typedef vector<int> vi;
typedef vector<ll> vl;

const ll INF = INT_MAX/3;
const ll MOD = 1000000007;
const double EPS = 1e-14;
const int dx[] = {1,0,-1,0} , dy[] = {0,1,0,-1};

int main(){
    while(true){
	string s;
	string ans = "";
	getline(cin,s);
	if(s == "END OF INPUT") break;
	s = ' ' + s + ' ';
	REP(i,s.size()){
	    FOR(j,i+1,s.size()){
		if(s[j] == ' ') {
		    ans += to_string(j-i-1);
		    i = j;
		}
	    }
	}
	cout << ans << endl;

    }

    return 0;
}

C++: #include<iostream>
#include<set>
#include<string>
#include<algorithm>
using namespace std;
int main() {
	string a;
	while (getline(cin,a)&&a != "END OF INPUT") {
		string h="";
		string g= "";
		a += " ";
		for (int i = 0; i < a.length(); i++) {
			if (a[i] == ' ') {
				g+=to_string(h.length());
				h = "";
			}
			else
				h += a[i];
		}
		cout <<g<< endl;
	}
}