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 <cstdio>
#include <cctype>
#include <utility>
#include <iostream>
#include <string>
using namespace std;

#define _gp(l) const auto gcu{getchar##l}; const auto pcu{putchar##l}
#ifdef __linux
_gp(_unlocked);
#else
_gp();
#endif
#define _DEF(r, n, ...) inline r n(__VA_ARGS__) noexcept
#define _T template <typename T>
#define _HT template <typename H,typename... T>
_T _DEF(T,in,int c){T n=0;int m=1;while(isspace(c)){c=gcu();}if(c=='-')m=-1,c=gcu();
	do{n=10*n+(c-'0'),c=gcu();}while(c>='0'&&c<='9');return m*n;}
_DEF(int,in,){return in<int>(gcu());}
#define _SCAN(...) _DEF(bool,scan,__VA_ARGS__)
_T _SCAN(T &n){int c=gcu();return c==EOF?false:(n=in<T>(c),true);}
_DEF(bool, scan, int &c){c=gcu();gcu();return c!=EOF;}
#ifdef _GLIBCXX_STRING
_SCAN(string &s){int c;s="";
	for(;;){c=gcu();if(c=='\n'||c==' ')return true;else if(c==EOF)return false;s+=(char)c;}}
#endif
_HT _SCAN(H &h,T&&... t){return scan(h)&&scan(t...);}
#define _OUT(...) _DEF(void,out,__VA_ARGS__)
#define _OUTL(...) _DEF(void,outl,__VA_ARGS__)
_OUT(bool b){pcu('0'+b);} _OUT(const char *s){while(*s)pcu(*s++);} _OUT(char c){pcu(c);}
#ifdef _GLIBCXX_STRING
_OUT(string s){for(char c:s)pcu(c);}
#endif
_T _OUT(T n){static char b[20];char *p=b;T m=n<0?pcu('-'),-1:1;
	if(!n)*p++='0';else while(n)*p++=(char)(n%10*m+'0'),n/=10;while(p!=b)pcu(*--p);}
_OUTL(){out('\n');}
#ifdef _GLIBCXX_VECTOR
_T _OUT(vector<T> v){for(T &x:v)out(&x == &v[0]?"":" "),out(x);}
#endif
_HT _OUT(H&& h, T&&... t){out(h);out(move(t)...);}
template <typename... T> _OUTL(T&&... t){out(move(t)...);outl();}
struct range{
	int e,b=0,s=1; range(int _b,int _e,int _s):e(_e),b(_b),s(_s){} range(int _b,int _e): e(_e), b(_b){} range(int _e):e(_e){}
	struct it { int v, s; it (int _v, int _s) : v(_v), s(_s) {} operator int()const{return v;} operator int&(){return v;} int operator*()const{return v;}
		it& operator++(){v+=s;return *this;} }; it begin() {return {b, s};} it end() {return {e, s};}};

int main() {
	for (string s; getline(cin, s), s != "END OF INPUT";) {
		int w {};
		for (char c: s)
			if (c == ' ') {
				out(w);
				w = 0;
			} else
				w++;
		outl(w);
	}
}

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[i-1] == ' '){
			cout << 0 << endl;
		}else
			cout << i-n << endl;
	}
	return 0;
}

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

using namespace std;

int main(int argc, char *argv[]) {
  string s;
  while (true) {
    getline(cin, s);
    if (s == "END OF INPUT")
      break;
    string result;
    int count = 0;
    for (int i = 0; i < s.size(); i++) {
      if (('a' <= s[i] && s[i] <= 'z') ||
          ('A' <= s[i] && s[i] <= 'Z')) {
        count++;
      } else if (count == 0 && s[i] == ' ') {
        result += '0';
      } else if (s[i] == ' ') {
        result += (char)(count+'0');
        count = 0;
      }
    }
    result += (char)(count+'0');

    cout << result << 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"){
        if(s.size()==0){
            cout << 0 << endl;
            continue;
        }
        stringstream ss(s);
        string t;
        while(ss >> t){
            cout << t.size();
        }
        cout << endl;
    }
}

C++: #include<map>
#include<set>
#include<list>
#include<cmath>
#include<queue>
#include<stack>
#include<cstdio>
#include<string>
#include<vector>
#include<complex>
#include<cstdlib>
#include<cstring>
#include<climits>
#include<numeric>
#include<sstream>
#include<iostream>
#include<algorithm>
#include<functional>

using namespace std;

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

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

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

using namespace std;

#define dump(n) cout<<"# "<<#n<<"="<<(n)<<endl
#define debug(n) cout<<__FILE__<<","<<__LINE__<<": #"<<#n<<"="<<(n)<<endl
#define repi(i,a,b) for(int i=int(a);i<int(b);i++)
#define rep(i,n) repi(i,0,n)
#define iter(c) __typeof((c).begin())
#define foreach(i,c) for(iter(c) i=(c).begin();i!=(c).end();i++)
#define allof(c) (c).begin(),(c).end()
#define mp make_pair

typedef unsigned int uint;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef pair<int,int> pii;

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

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

using namespace std;

int main(){
  string str;
  while(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;
  }
}