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"
#include<unordered_map>
#include<unordered_set>
#pragma warning(disable:4996)
using namespace std;
using ld = double;
const ld eps = 1e-9;
//
//using Graph = vector<vector<int>>;
//
//int dfs(const Graph&g, const int now, vector<int>&ch_cnts) {
//  ch_cnts[now]++;
//  for (auto&& e : g[now]) {
//      ch_cnts[now] += dfs(g, e, ch_cnts);
//  }
//  return ch_cnts[now];
//}
//
//struct HL_Edge {
//  int from;
//  int to;
//  bool heavy;
//};
//
//void dfs2(const Graph&g, vector<vector<HL_Edge>>&hl_tree, const int now, const vector<int>&ch_cnts) {
//
//  int max_ch_id = 1;
//  {
//      int max_ch_num = -1;
//      for (auto&&e : g[now]) {
//          if (max_ch_num < ch_cnts[e]) {
//              max_ch_num = ch_cnts[e];
//              max_ch_id = e;
//          }
//      }
//  }
//  for (auto e : g[now]) {
//      bool heavy = (e == max_ch_id);
//
//      hl_tree[now].push_back(HL_Edge{ now,e,heavy });
//  }
//  return;
//}
//
//void HL(const vector<vector<int>>&ro_tree) {
//  vector<int>ch_cnts(ro_tree.size());
//
//  dfs(ro_tree, 0, ch_cnts);
//
//  vector<vector<HL_Edge>>hl_tree(ro_tree.size());
//
//  dfs2(ro_tree, hl_tree, 0, ch_cnts);
//}
//
//namespace FastFourierTransform
//{
//  using C = complex< double >;
//
//  void DiscreteFourierTransform(vector< C > &F, bool rev)
//  {
//      const int N = (int)F.size();
//      const double PI = (rev ? -1 : 1) * acos(-1);
//      for (int i = 0, j = 1; j + 1 < N; j++) {
//          for (int k = N >> 1; k > (i ^= k); k >>= 1);
//          if (i > j) swap(F[i], F[j]);
//      }
//      C w, s, t;
//      for (int i = 1; i < N; i <<= 1) {
//          for (int k = 0; k < i; k++) {
//              w = polar(1.0, PI / i * k);
//              for (int j = 0; j < N; j += i * 2) {
//                  s = F[j + k];
//                  t = C(F[j + k + i].real() * w.real() - F[j + k + i].imag() * w.imag(),
//                      F[j + k + i].real() * w.imag() + F[j + k + i].imag() * w.real());
//                  F[j + k] = s + t, F[j + k + i] = s - t;
//              }
//          }
//      }
//      if (rev) for (int i = 0; i < N; i++) F[i] /= N;
//  }
//
//  vector< int> Multiply(const vector<int > &A, const vector<int > &B)
//  {
//      int sz = 1;
//      while (sz <= A.size() + B.size()) sz <<= 1;
//      vector< C > F(sz), G(sz);
//      for (int i = 0; i < A.size(); i++) F[i] = A[i];
//      for (int i = 0; i < B.size(); i++) G[i] = B[i];
//      DiscreteFourierTransform(F, false);
//      DiscreteFourierTransform(G, false);
//      for (int i = 0; i < sz; i++) F[i] *= G[i];
//      DiscreteFourierTransform(F, true);
//      vector< int > X(A.size() + B.size() - 1);
//      for (int i = 0; i < A.size() + B.size() - 1; i++) X[i] = F[i].real() + 0.5;
//      return (X);
//  }
//};

struct aa {
	string name;
	int l;
	int r;
	int u;
	int d;
	vector<shared_ptr<aa>>chs;
};

int get_num(string st, int&a) {
	int num=0;
	while (a != st.size() && isdigit(st[a])) {
		num*=10;
		num+=st[a]-'0';
		a++;
	}
	return num;
}

string get_name(string st, int &a) {
	string name="";
	while (a != st.size() && 'a' <= st[a] && st[a] <= 'z') {
		name+=st[a];
		a++;
	}
	return name;
}

string get_on_name(string st,bool flag, int &a) {
	assert(st[a]=='<');
	a++;
	if (flag) {
		assert(st[a]=='/');
		a++;
	}
	string name=get_name(st,a);
	assert(st[a]=='>');
	a++;
	return name;
}



pair<pair<int, int>, pair<int, int>>get_on_num(string st, int &a) {
	int l=get_num(st,a);
	assert(st[a]==',');
	a++;
	int u=get_num(st,a);
	assert(st[a]==',');
	a++;
	int r=get_num(st,a);
	assert(st[a]==',');
	a++;
	int d=get_num(st,a);

	return make_pair(make_pair(l,r),make_pair(u,d));
}

shared_ptr<aa>solve(string st, int &a) {

	aa now;
	string aname=get_on_name(st,false,a);
	now.name=aname;



	auto p=get_on_num(st,a);
	now.l=p.first.first;
	now.r=p.first.second;
	now.u=p.second.first;
	now.d=p.second.second;

	while (st[a + 1] != '/') {
		auto naa=solve(st,a);
		now.chs.push_back(naa);
	}
	get_on_name(st,true,a);
	return make_shared<aa>(now);
}

vector<string> split(const string &str, char delim) {
	vector<string> res;
	size_t current = 0, found;
	while ((found = str.find_first_of(delim, current)) != string::npos) {
		res.push_back(string(str, current, found - current));
		current = found + 1;
	}
	res.push_back(string(str, current, str.size() - current));
	return res;
}

int main() {
	while (true) {
		string st;
		getline(cin,st);
		if(st=="END OF INPUT")break;
		auto ps=split(st,' ');
		string anss;
		for (auto p : ps) {
			anss.push_back('0'+p.size());
		}
		cout<<anss<<endl;
	}
	
	return 0;
}

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

int main() {
  string s;
  while(getline(cin, s) && s!="END OF INPUT") {
    char str[s.length()+1];
    strcpy(str, s.c_str());
    char *p = strtok(str, " ");
    while(p!=NULL) {
      cout << strlen(p);
      p = strtok(NULL, " ");
    }
    cout << endl;
  }
}

C++: #include<iostream>
#include<string>
using namespace std;
int main(){
	string a;
	while(getline(cin,a)){
		if(a=="END OF INPUT")
			break;
		bool t=false;
		int count=0;
		for(int i=0;i<a.size();i++){
			if(a[i]==' '&&t==false){
				cout<<count;
				count=0;
				t=true;
			}
			else{
				count++;
				t=false;
			}
		}
		cout<<count<<endl;
	}
    return 0;
}

C++: #include <iostream>
#include <string>
using namespace std;
int main(){
    string s;
    
    while(true){
        getline(cin, s);
        if(s == "END OF INPUT") break;

        //cout << s.size() << endl;
        int count = 0;
        for(int i = 0; i < s.size(); i++){
            if(s[i] == ' '){
                cout << count;
                count = 0;
            }
            else count++;
        }
        cout << count << endl;
    }  
}

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

int main(){
    vector<int> result;
    string input;

    input += '\0';
    while(getline(cin, input), input !="END OF INPUT"){
        result.clear();
        int i = 0;
        int begin = 0;
        while(i<=input.size()){
            if(input[i] == ' ' || input[i] == '\0'){
                result.push_back(i-begin);
                begin = i + 1;
                i = begin;
            }
            else{
                i++;
            }
        }
        for(int i=0; i<result.size(); i++){
            cout << result[i];
        }
        cout << endl;
    }
    return 0;
}