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 <bits/stdc++.h>
#define rep(i,l,n) for(int i=l;i<n;i++)
#define rer(i,l,n) for(int i=l;i<=n;i++)
#define all(a) a.begin(),a.end()
#define o(a) cout<<a<<endl
#define pb(a) push_back(a)
#define mk(a,b) make_pair(a,b)
#define fi first
#define se second
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> pii;

vector<string> split(const string &s,char c=' '){
	vector<string> ret;
	stringstream ss(s);
	string t;
	while(getline(ss,t,c)){
		ret.pb(t);
	}
	return ret;
}

int main(){
	string s;
	while(getline(cin,s)){
		if(s=="END OF INPUT") break;
		vector<string> ss=split(s,' ');
		string ans="";
		//rep(i,0,ss.size()) cout<<ss[i].size();
		//cout<<endl;
		rep(i,0,ss.size()){
			stringstream stream;
			stream<<ss[i].size();
			ans+=stream.str();
		}
		o(ans);
	}
}

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

void split(string& str, vector<string>& v){
  string::size_type index_space = str.find_first_of(" ");
  if(index_space!=string::npos){
    v.emplace_back(str.substr(0,index_space));
    string s(str.substr(index_space+1));
    split(s, v);
  }else{
    v.emplace_back(str);
  }
  return;
}

int main(){
  while(true){
    string str; getline(cin,str);
    if(str=="END OF INPUT") break;
    vector<string> v;
    split(str,v);

    for(int i=0;i<v.size();++i){
      if(v[i]==",") cout<<".";
      else cout<<v[i].size();
    }
    cout<<endl;
  }

  return 0;
}

C++: #include <iostream>
using namespace std;
int main(){
  string str;
  while(getline(cin,str)){
    int cnt = 0;
    for(int i = 0 ; i < str.size() ; i++ ){
      if(str[i] == ' '){
	cout << cnt;
	cnt = 0;
      }else cnt++;
    }
      cout << cnt << endl;
  }
}

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<set>
#include<string>
#include<algorithm>
using namespace std;
int main() {
	string a;
	while (cin >> a&&a != "END OF INPUT") {
		string h="";
		string g= "";
		a += " ";
		for (int i = 0; i < a.length(); i++) {
			if (a[i] == ' ') {
				g+=to_string(h.length());
				h = "";
			}
			else
				h += a[i];
		}
		cout <<g<< 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 <numeric>
#include <sstream>
#include <iostream>
#include <algorithm>
#include <functional>

#define mp       make_pair
#define pb       push_back
#define all(x)   (x).begin(),(x).end()
#define rep(i,n) for(int i=0;i<(n);i++)
#define repi(i,a,b) for(int i = (a); i < (b); i++)

using namespace std;

typedef    long long          ll;
typedef    unsigned long long ull;
typedef    vector<bool>       vb;
typedef    vector<int>        vi;
typedef    vector<vb>         vvb;
typedef    vector<vi>         vvi;
typedef    pair<int,int>      pii;

const int INF=1<<29;
const double EPS=1e-9;

const int dx[]={1,0,-1,0},dy[]={0,-1,0,1};

int main(){
	string str;
	while(1){
		getline(cin,str);
		if(str=="END OF INPUT")break;
		stringstream ss;
		ss <<str;

		while(ss>>str){
			int x =str.length();
			cout <<x;
		}
		cout<<endl;
	}
	return 0;
}

C++: #include <bits/stdc++.h>
#define rep(i,l,n) for(int i=l;i<n;i++)
#define rer(i,l,n) for(int i=l;i<=n;i++)
#define all(a) a.begin(),a.end()
#define o(a) cout<<a<<endl
#define pb(a) push_back(a)
#define mk(a,b) make_pair(a,b)
#define fi first
#define se second
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> pii;

vector<string> split(const string &s,char c=' '){
	vector<string> ret;
	stringstream ss(s);
	string t;
	while(getline(ss,t,c)){
		ret.pb(t);
	}
	return ret;
}

int main(){
	string s;
	while(getline(cin,s)){
		if(s=="END OF INPUT") break;
		vector<string> ss=split(s,' ');
		string ans="";
		rep(i,0,ss.size()) cout<<ss[i].size();
		cout<<endl;
		/*rep(i,0,ss.size()){
			stringstream stream;
			stream<<ss[i].size();
			ans+=stream.str();
		}
		o(ans);*/
	}
}

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 += ' '; //add 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<iostream>
using namespace std;

int main(){
  string str;

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

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

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