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<bits/stdc++.h>

using namespace std;

int main() {
	int pos, start;
	string input, tmp;

	while (true) {
		getline(cin, input);
		if (input == "END OF INPUT") {
			break;
		}
//		cout << input << "_out" << endl;
		start = 0;
		pos = input.find(" ", start);
		while (pos != string::npos) {
			tmp = input.substr(start, pos - start);
			//cout << "tmp:" << tmp << endl;
			cout << tmp.size();
			start = pos + 1;
			while (input[start] == ' ') {
				++start;
			}
			while (start - pos != 1) {
				cout << "0";
				++pos;
			}
			pos = input.find(" ", start);
		}
		tmp = input.substr(start, pos - start);
		cout << tmp.size() << endl;
	}
	
	return 0;
}

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

using namespace std;

void solve()
{
	string str;
	while(getline(cin, str))
	{
		if(str == "END OF INPUT")
		{
			break;
		}
		int count = 0;
		int size = str.size();
		for(int i = 0; i < size; ++i)
		{
			if(str[i] == ' ')
			{
				cout << count;
				count = 0;
			}
			else
			{
				count++;
			}
		}
		cout << count << endl;
	}
}

int main()
{
	solve();
	return(0);
}

C++: #include<iostream>
using namespace std;
string s;
long long int a;
int j,i;
int main(){
  for(;getline(cin,s),s!="END OF INPUT";){
    int m=int(s.size());
    for(j=a=i=0;i<m;i++){
      if(s[i]==' '){
	cout<<i-j;
	j=i+1;
      }
    }
    cout<<m-j<<endl;
  }
}

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


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

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

int main(){
    string s;
    while(getline(cin, s)){
        if(s == "END OF INPUT") break;
        int cnt = 0;
        bool in = true;
        for(int i = 0; i < s.length(); i++){
            if(s[i] != ' '){
                in = true;
                cnt++;
            }else{
                if(in){
                    cout << cnt;
                    cnt = 0;
                    in = false;
                }else{
                    in = true;
                }
            }
        }
        cout << cnt << endl;
    }   
    return 0; 
}

C++: #include <iostream>
#include <vector>
#include <algorithm>
#include <numeric>
#include <set>
#include <map>
#include <string>
#include <stack>
#include <queue>
#include <cmath>
#include <cstdio>
#include <istream>
#include <sstream>
#include <iomanip>
#include <iterator>
#include <climits>
using namespace std;

typedef ostringstream OSS;
typedef istringstream ISS;

typedef vector<int> VI;
typedef vector< VI > VVI;

typedef long long LL;

typedef pair<int, int> PII;
typedef vector<PII> VPII;

#define X first
#define Y second

// 1テヲツ鳴?・ツュツ耀plit ティツヲツ《stream
vector<string> split(const string &str, char delim) {
	istringstream iss(str); string tmp; vector<string> res;
	while(getline(iss, tmp, delim)) res.push_back(tmp);
	return res;
}

int main(void) {
	string s;

	while (true) {
		getline(cin, s);
		if (s == "END OF INPUT") break;
		
		vector<string> ws = split(s, ' ');
		for (auto w : ws) {
			cout << w.size();
		}
		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;
				cont = 0;
			} else {
				cont++;
			}
		}

		cout << cont << endl;
	}

	return 0;
}

C++: #include <stdio.h>
#include<math.h>
#include <algorithm>
using namespace std;

int main(){
	char buf[100000];
	int length;

	while(true){
		fgets(buf,10000,stdin);
		if(buf[0] == 'E' && buf[1] == 'N' && buf[2] == 'D' && buf[3] == ' ' &&
				buf[4] == 'O' && buf[5] == 'F' && buf[6] == ' ' && buf[7] == 'I' &&
				buf[8] == 'N' && buf[9] == 'P' && buf[10] == 'U' && buf[11] == 'T')break;
		length = 0;
		for(int i=0;buf[i] != '\n';i++){
			if(buf[i+1] == '\n'){
				length++;
				printf("%d",length);
			}else if(buf[i] == ' '){
				printf("%d",length);
				length = 0;
			}else{
				length++;
			}
		}
		printf("\n");
	}


    return 0;
}

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

const string eof = "END OF INPUT";
typedef vector <string> VS;
typedef vector <int> VI;
typedef istringstream ISS;

int main() {
    string line;
    while ( getline( cin, line ) ) {
        if ( line == eof ) break;
        string s = line;
        int n = s.size();
        n--;
        int cnt = 0;
        VI L;
        for ( int i = 0; i < n; ++ i ) {
            cnt = 0;
            for ( ; i < n; ) {
                if ( s[i] == ' ' ) break;
                cnt ++;
                i ++;
            }
            L.push_back( cnt );
        }
        for ( VI::iterator it_i = L.begin(); it_i != L.end(); ++ it_i ) {
            cout << *it_i;
        }
        cout << endl;
    }
	return 0;
}

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

using namespace std;

char *c;
int n;

int main() {
	string s;
	string a = "OUT OF INPUT";

	while (1) {
		getline(cin, s);
		if (s == a) {
			cout << endl;
			break;
		}
		n = s.length();
		int series = 0;
		for (int i = 0; i < n; i++) {
			if (s[i] == ' ') {
				if (i > 0) {
					if (s[i - 1] == ' ') {
						cout << "0";
						continue;
					}

				}
				cout << series;
				series = 0;
				continue;
			}
			series++;
			if (i == n - 1)
				cout << series;
		}
		cout << endl;
	}


	return 0;
}

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

const string eof = "END OF INPUT";
typedef vector <string> VS;
typedef vector <int> VI;
typedef istringstream ISS;

int main() {
    string line;
    while ( getline( cin, line ) ) {
        if ( line == eof ) break;
        string s = line;
        int n = s.size();
        n --;
        int cnt = 0;
        VI L;
        for ( int i = 0; i < n; ++ i ) {
            if ( s[i] == ' ' ) {
                if ( i > 0 && s[i-1] == ' ' ) {
                    L.push_back( 0 );
                } else {
                    L.push_back( cnt );
                }
                cnt = 0;
            } else {
                cnt ++;
            }
        }
        if ( cnt > 0 ) L.push_back( cnt );
        for ( VI::iterator it_i = L.begin(); it_i != L.end(); ++ it_i ) {
            cout << *it_i;
        }
        cout << endl;
    }
	return 0;
}