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;

/** Application main entry point. */
int main (
  int     argc,
  char  * argv[ ]
  )
{
  for ( ; ; )
  {
    int           res = 0;
    string        s;
    const char  * p;

    getline ( cin, s );
    if ( s == "END OF INPUT" )  break ;

    for ( p = s.c_str ( ); *p != '\0'; ++p )
    {
      if ( isspace ( *p ) )
      {
        cout << res;
        res = 0;
      }
      else
      {
        ++res;
      }
    }
    cout << res << endl;
  }

  return ( 0 );
}

C++: # include <bits/stdc++.h>
using namespace std;
using LL = long long;
using ULL = unsigned long long;
const double PI = acos(-1);
template<class T>constexpr T INF() { return ::std::numeric_limits<T>::max(); }
template<class T>constexpr T HINF() { return INF<T>() / 2; }
template <typename T_char>T_char TL(T_char cX) { return tolower(cX); };
template <typename T_char>T_char TU(T_char cX) { return toupper(cX); };
template<typename T>vector<T> make_v(size_t a){ return vector<T>(a); }
template<typename T,typename... Ts>auto make_v(size_t a, Ts... ts){ return vector<decltype(make_v<T>(ts...))>(a,make_v<T>(ts...)); }
template<typename T,typename V>typename enable_if<is_class<T>::value==0>::type fill_v(T &t, const V &v){ t = v; }
template<typename T,typename V>typename enable_if<is_class<T>::value!=0>::type fill_v(T &t, const V &v){ for(auto &e : t) fill_v(e, v); }
const int vy[] = { -1, -1, -1, 0, 1, 1, 1, 0 }, vx[] = { -1, 0, 1, 1, 1, 0, -1, -1 };
const int dx[4] = { 0,1,0,-1 }, dy[4] = { 1,0,-1,0 };
int popcnt(unsigned long long n) { int cnt = 0; for (int i = 0; i < 64; i++)if ((n >> i) & 1)cnt++; return cnt; }
int d_sum(LL n) { int ret = 0; while (n > 0) { ret += n % 10; n /= 10; }return ret; }
int d_cnt(LL n) { int ret = 0; while (n > 0) { ret++; n /= 10; }return ret; }
LL gcd(LL a, LL b) { if (b == 0)return a; return gcd(b, a%b); };
LL lcm(LL a, LL b) { LL g = gcd(a, b); return a / g*b; };
# define ALL(qpqpq)           (qpqpq).begin(),(qpqpq).end()
# define UNIQUE(wpwpw)        sort(ALL((wpwpw)));(wpwpw).erase(unique(ALL((wpwpw))),(wpwpw).end())
# define LOWER(epepe)         transform(ALL((epepe)),(epepe).begin(),TL<char>)
# define UPPER(rprpr)         transform(ALL((rprpr)),(rprpr).begin(),TU<char>)
# define FOR(i,tptpt,ypypy)   for(LL i=(tptpt);i<(ypypy);i++)
# define REP(i,upupu)         FOR(i,0,upupu)
# define INIT                 std::ios::sync_with_stdio(false);std::cin.tie(0)

string s;

int main(){
    while(getline(cin, s)){
        if(s == "END OF INPUT")return 0;
        int cnt = 1;
        for(int i = 1;i <(int)s.size();i++){
            if(('a' <= s[i] && s[i] <= 'z') || ('A' <= s[i] && s[i] <= 'Z')){
                cnt++;
            }else{
                cout << cnt;
                cnt = 0;
            }
        }
        if(cnt)cout << cnt;
        cout << 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 << endl;
  }
}

C++: #include <iostream>
#include <stdio.h>
using namespace std;
int main(){
    string s;
    int temp;
    while(true){
        getline(cin,s);
        if(s=="END OF INPUT")return 0;
        temp=0;
        for(int i=0;i<s.size();i++){
            if(s[i]==' '){
                printf("%d",temp);
                temp=0;
            }
            else temp++;
        }
        printf("%d\n",temp);
    }
}

C++: #include <iostream>

using namespace std;

int main(){
    string a;
    while (getline(cin,a)&&a!="END OF INPUT"){
        int num=0;
        for(int i=0;i<a.length();++i){
            if(a[i]==" ") {
                cout << num;
                num=0;
            }else num++;
        }
        cout << endl;
    }
}

C++: #include<iostream>
#include<algorithm>
#include<cstdio>
#include<cmath>
#include<math.h>
#include<string>
#include<string.h>
#include<stack>
#include<queue>
#include<vector>
#include<utility>
#include<set>
#include<map>
#include<stdlib.h>
#include<iomanip>

using namespace std;

#define ll long long
#define ld long double
#define EPS 0.0000000001
#define INF 1e9
#define MOD 1000000007
#define rep(i,n) for(i=0;i<n;i++)
#define loop(i,a,n) for(i=a;i<n;i++)
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)

typedef vector<int> vi;
typedef pair<int,int> pii;

int main(void) {
  int i,j;
  string s;
  while(1){
    getline(cin,s);
    if(s=="END OF INPUT")break;
    int ans=0;
    s=s+" ";
    rep(i,s.size()){
      if(s[i]==' '){
	cout<<ans;
	ans=0;
      }else{
	ans++;
      }
    }
    cout<<endl;
  }
}

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;
		for(int i = 0; i < str.size(); ++i)
		{
			if(str[i] == ' ')
			{
				cout << count;
				count = 0;
			}
			else
			{
				++count;
			}
		}
		cout << count << endl;
	}
}

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

C++: #include <iostream>
#include <sstream>
#include <string>
using namespace std;
int main( void )
{
	string input;
	while ( getline( cin, input ) && input != "END OF INPUT" )
	{
		for ( string::iterator it = input.begin(); it != input.end(); it++ )
		{
			if ( ( *it >= 'A' && *it <= 'Z' ) || ( *it >= 'a' && *it < 'z' ) ) *it = 'a';
		}

		string answer = "";
		char prev = ' ';
		int length = 0;
		for ( string::iterator it = input.begin(); it != input.end(); it++ )
		{
			char& now = *it;
			if ( it != input.begin() && now == ' ' && prev == ' ' )
			{
				answer += '0';
				while ( it != input.end() && *it != 'a' ) it++;
				it--;
			}
			else if ( now == 'a' )
			{
				length++;
			}
			else if ( now == ' ' && prev == 'a' )
			{
				answer += ( '0' + length );
				length = 0;
			}
			prev = now;
		}
		if ( length ) answer += ( '0' + length );

		cout << answer << endl;
	}
	return 0;
}

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

#define LP(i,n) for(int i=0;i<n;i++)
#define Mset(x,v) memset(x,v,sizeof(x))
#define INF INT_MAX

using namespace std;
using LL=long long;

int main(){
    string s;
    while(1){
        getline(cin,s);
        if(s=="END OF INPUT") break;
        int c=0;
        LP(i,s.size()+1){
            if(s[i]==' '||i==s.size()){
                cout<<c;
                c=0;
            }
            else c++;
        }
        cout<<endl;
    }
    return 0;
}

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

using namespace std;

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