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

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 <iostream>
#include <string>
#include <algorithm>

using namespace std;

int main()
{
  string str("END OF INPUT");
  int size;

  while(1){
    size = 0;
    string v;
    getline(cin,v);

    if(v == str){
      break;
    }

    for(char e : v){
      if(e == ' '){
        cout<<size;
        size = 0;
      } 
      else{
        size++;
      } 
    }
    cout<<size<<endl;
  }
  return 0;
}

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

using namespace std;

int main(void){
  string s;  

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

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

  return 0;
}

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

#define loop(i,a,b) for(int i=(a);i<int(b);i++)
#define rep(i,b) loop(i,0,b)

int main(){
    string s;
    while (getline(cin, s) , s != "END OF INPUT"){
        if(s.size()==0){
            cout << 0 << endl;
            continue;
        }
        stringstream ss(s);
        string t;
        while(ss >> t){
            cout << t.size();
        }
        cout << endl;
    }
}

C++: #include <bits/stdc++.h>
using namespace std;

int main() {
  string s;
  while(true) {
    getline(cin, s);
    if (s == "END OF INPUT") break;
  
    int cnt = 0;
    for (auto c : s) {
      if (c == ' ') {
	cout << cnt;
	cnt = 0;
      }
      else {
	cnt++;
      }
    }
    cout << cnt << endl;
  }
  return 0;
}

C++: #include<iostream>
#include<set>
#include<string>
#include<algorithm>
using namespace std;
int main() {
	string a;
	while (getline(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 <iostream>
#include <algorithm>
#include <string>

using namespace std;
int main() {
	string s;
	while (getline(cin, s), s != "END OF INPUT") {
		for (int i = 0, n = 0; i <= s.length(); i++) {
			if (i == s.length() || s[i] == ' ') {
				cout << n;
				n = 0;
			} else {
				n++;
			}
		}
		cout << endl;
	}
	return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;

int main() {
    string str;
    while (getline(cin, str)) {
        if (str == "END OF INPUT") break;
        stringstream ss;
        ss << str;
        string s;
        while (ss >> s) cout << s.size();
        cout << endl;
    }

    return 0;
}

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

int main() {
    const string endLine = "END OF INPUT";
    while (true) {
        string line;
        getline(cin, line);
        if (line == endLine) {
            break;
        }
        while (line.length() > 0) {
            int spacePos = (int) line.find_first_of(' ');
            if (spacePos == (int) string::npos) {
                cout << line.length();
                line.clear();
            } else {
                cout << spacePos;
                line.erase(0, spacePos + 1);
            }
        }
        cout << endl;
    }
}

C++: #include <cstdio>
#include <cstring>
#include <vector>
#include <string>
#include <map>
#include <queue>
#include <stack>
#include <algorithm>

#define rep(i, j) FOR(i, 0, j)
#define FOR(i, j, k) for(int i = j; i < k; ++i)

using namespace std;

int main(){
  char buf[1000], *s;
  while(fgets(buf, sizeof(buf), stdin)){
    if(strcmp(buf,"END OF INPUT")==0) break;
    if(buf[0]=='E'&&buf[1]=='N'&&buf[2]=='D'&&buf[3]==' '&&buf[4]=='O'&&buf[5]=='F'&&buf[6]==' '&&buf[7]=='I'&&buf[8]=='N'&&buf[9]=='P'&&buf[10]=='U'&&buf[11]=='T') break;
    s = strtok(buf, " \n");
    while(s != NULL){
      printf("%d", (int)strlen(s));
      s = strtok(NULL, " \n");
    }
    puts("");
  }
  return 0;
}

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

using namespace std;

int main()
{
  string str("END OF INPUT");
  int size;

  while(1){
    size = 0;
    string v;
    getline(cin,v);

    if(v == str){
      break;
    }

    for(char e : v){
      if(e == ' '){
        cout<<size;
        size = 0;
      } 
      else{
        size++;
      } 
    }
    cout<<size<<endl;
  }
  return 0;
}

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

using namespace std;

string solve(string str) {
    string ans;

    // split
    vector<string> results;    
    stringstream ss(str);
    string buffer;
    char sep = ' ';
    while( std::getline(ss, buffer, sep) ) {
        results.push_back(buffer);
    }

    const int size = results.size();
    for (int i = 0; i < size; ++i) {   
        string tmp = to_string(results[i].length());
        ans += tmp;
    }

    return ans;
}

int main(int argc, char const *argv[]) {
    string str;
    const string end("END OF INPUT");

    while (getline(cin, str), str != end) {
        cout<<solve(str)<<endl;
    }
    return 0;
}

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