Go: package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

func configure(scanner *bufio.Scanner) {
	// scanner.Split(bufio.ScanWords)
	scanner.Buffer(make([]byte, 1000005), 1000005)
}
func getNextString(scanner *bufio.Scanner) string {
	scanned := scanner.Scan()
	if !scanned {
		panic("scan failed")
	}
	return scanner.Text()
}
func getNextInt(scanner *bufio.Scanner) int {
	i, _ := strconv.Atoi(getNextString(scanner))
	return i
}
func getNextInt64(scanner *bufio.Scanner) int64 {
	i, _ := strconv.ParseInt(getNextString(scanner), 10, 64)
	return i
}
func getNextFloat64(scanner *bufio.Scanner) float64 {
	i, _ := strconv.ParseFloat(getNextString(scanner), 64)
	return i
}
func main() {
	fp := os.Stdin
	wfp := os.Stdout
	extra := 0
	if os.Getenv("I") == "IronMan" {
		fp, _ = os.Open(os.Getenv("END_GAME"))
		extra = 100
	}
	scanner := bufio.NewScanner(fp)
	configure(scanner)
	writer := bufio.NewWriter(wfp)
	defer func() {
		r := recover()
		if r != nil {
			fmt.Fprintln(writer, r)
		}
		writer.Flush()
	}()
	solve(scanner, writer)
	for i := 0; i < extra; i++ {
		fmt.Fprintln(writer, "-----------------------------------")
		solve(scanner, writer)
	}
}
func solve(scanner *bufio.Scanner, writer *bufio.Writer) {
	for s := getNextString(scanner); s != "END OF INPUT"; s = getNextString(scanner) {
		ss := strings.Split(s, " ")
		for i := 0; i < len(ss); i++ {
			fmt.Fprint(writer, len(ss[i]))
		}
		fmt.Fprintln(writer, "")
	}
}

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