#include<bits/stdc++.h>
#define rep(i,n)for(int i=0;i<n;i++)
using namespace std;

int main() {
	string s;
	while (getline(cin, s), s != "END OF INPUT") {
		string res;
		s += ' ';
		replace(s.begin(), s.end(), ' ', '+');
		stringstream ss(s);
		char c;
		int cnt = 0;
		while (ss >> c) {
			if (c == '+') {
				res += to_string(cnt);
				cnt = 0;
			}
			else cnt++;
		}
		cout << res << endl;
	}
}