#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") {
        int res = 0;
        rep(i,s.size()){
            if(s[i] == ' ') {
                cout << res;
                res = 0;
            } else {
                res ++;
            }
        }
        cout << res << endl;
    }
}