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

int main(){
	while (getline(cin, s)){
		if (s == "END OF INPUT")break;
		bool f = 1;
		REP(i, s.size()){
			if (s[i] != ' ')f = 0;
		}
		if (f)cout << 0 << endl;
		string buf;
		stringstream ss;
		ss << s;
		while (ss >> buf){
			cout << buf.size();
		}
		cout << endl;
	}
}

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

using namespace std;

int main(){
  string str;
  while(cin >> str){
    if(str == "END_OF_INPUT") break;
    str += " ";
    int idx = 0;
    while(idx < str.size()){
      int cnt = 0;
      while(str[idx++]!=' ') cnt++;
      cout << cnt;
    }
    cout << endl;
  }
}

C++: #include <iostream>
#include <iomanip>
#include <sstream>
#include <vector>
#include <string>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <stack>
#include <queue>
#include <deque>
#include <algorithm>
#include <functional>
#include <iterator>
#include <limits>
#include <numeric>
#include <utility>
#include <cmath>
#include <cassert>
#include <cstdio>

using namespace std;
using namespace placeholders;

using LL = long long;
using ULL = unsigned long long;
using VI = vector< int >;
using VVI = vector< vector< int > >;
using VS = vector< string >;
using SS = stringstream;
using PII = pair< int, int >;
using VPII = vector< pair< int, int > >;
template < typename T = int > using VT = vector< T >;
template < typename T = int > using VVT = vector< vector< T > >;
template < typename T = int > using LIM = numeric_limits< T >;

template < typename T > inline istream& operator>>( istream &s, vector< T > &v ){ for ( T &t : v ) { s >> t; } return s; }
template < typename T > inline ostream& operator<<( ostream &s, const vector< T > &v ){ for ( int i = 0; i < int( v.size() ); ++i ){ s << ( " " + !i ) << v[i]; } return s; }
template < typename T > inline T fromString( const string &s ) { T res; istringstream iss( s ); iss >> res; return res; }
template < typename T > inline string toString( const T &a ) { ostringstream oss; oss << a; return oss.str(); }

#define REP2( i, n ) REP3( i, 0, n )
#define REP3( i, m, n ) for ( int i = ( int )( m ); i < ( int )( n ); ++i )
#define GET_REP( a, b, c, F, ... ) F
#define REP( ... ) GET_REP( __VA_ARGS__, REP3, REP2 )( __VA_ARGS__ )
#define FOR( e, c ) for ( auto &&e : c )
#define ALL( c ) begin( c ), end( c )
#define AALL( a, t ) ( t* )a, ( t* )a + sizeof( a ) / sizeof( t )
#define DRANGE( c, p ) ( c ).begin(), ( c ).begin() + ( p ), ( c ).end()

#define SZ( v ) ( (int)( v ).size() )
#define EXIST( c, e ) ( ( c ).find( e ) != ( c ).end() )

template < typename T > inline bool chmin( T &a, const T &b ){ if ( b < a ) { a = b; return true; } return false; }
template < typename T > inline bool chmax( T &a, const T &b ){ if ( a < b ) { a = b; return true; } return false; }

#define PB push_back
#define EM emplace
#define EB emplace_back
#define BI back_inserter

#define MP make_pair
#define fst first
#define snd second

#define DUMP( x ) cerr << #x << " = " << ( x ) << endl

int main()
{
	cin.tie( 0 );
	ios::sync_with_stdio( false );

	for ( string S; getline( cin, S ), S != "END OF INPUT"; )
	{
		S += ' ';
		
		for ( int pos = 0, npos; ( npos = S.find( ' ', pos ) ) != string::npos; pos = npos + 1 )
		{
			cout << npos - pos;
		}
		cout << endl;
	}

	return 0;
}

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

using namespace std;

int main(){

	string in;
	int len;

	while(getline(cin,in)){
		if(in=="END OF INPUT"){
			break;
		}
		len=0;
		for(int i=0;i<in.length();i++){
			if(in[i]==' '){
				cout<<len;
				len=0;
			}
			else{
				len++;
			}
		}
		cout<<len<<endl;
	}

}

C++: #include <bits/stdc++.h>
using namespace std;
int main(){
	
	cin.tie( 0 );
	ios::sync_with_stdio( false );
	
	string s;
	
	while( getline( cin, s ) ){
		
		if( s == "END OF INPUT" ){ return 0;}
		
		s += ' '; //SP??????
		int count {0};
		vector<int> vc;
		
		for( int i = 0; i < (int)s.size(); i++ ){
			
			if( s[i] != ' ' ){
				count++;
				continue;
			}
			
			vc.push_back( count );
			count = 0;
		
		}
		
		for( auto x : vc ){
			cout << x;
		}
		
		cout << endl;
		
	}
	
	return 0;

}

C++: #include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <cstring>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <fstream>
#include <complex>
#include <stack>
#include <queue>

using namespace std;
typedef long long LL;
typedef pair<int, int> PII;
static const double EPS = 1e-5;

#define FOR(i,k,n) for (int i=(k); i<(int)(n); ++i)
#define REP(i,n) FOR(i,0,n)

int main(void){
  string line;
  while(getline(cin,line)){
    if(line=="END OF INPUT") break;
    if(line==""){
      cout<<0<<endl;
      continue;
    }
    stringstream ss;
    ss<<line;
    string word;
    int s=0;
    while(ss>>word){
      s+=word.size()+1;
      cout<<word.size();
      while(s<line.size()&&line[s]==' '){
        cout<<0;
        s++;
      }
    }
    cout<<endl;
  }
  return 0;
}

C++: #include <iostream>
#include <stdio.h>
using namespace std;
int main(){
    string s;
    int temp;
    whlie(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++: /*
	1042:Yes, I have a number
*/
#include	<iostream>
#include	<string>

using namespace std;

int main(void) {
	while(1) {
		string str;
		
		getline(cin, str, '\n');
		if( str == "END OF INPUT" ) { break; }
		
		int c = 0;
		for(int i = 0; i < (int)str.length(); i++) {
			if(str[i] == ' ') {
				cout << c;
				c = 0;
			} else {
				c++;
			}
		}
		cout << c << endl;
	}
	return 0;
}

C++: #include<iostream>

using namespace std;


int main(){
  string s; int st;
 
  while(true){
  
    getline(cin,s,'\n');
 
    cout << s << endl;
    if(s == "END OF INPUT")break;
    st = 0;
    for(int i=0;i<=s.length();i++){
      if(s[i] == ' ' || i == s.length()){
	cout << i-st;
	st = i+1;
      }

    }
    cout << endl;


  }
  return 0;
}

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

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

using namespace std;

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