#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;
}