#include<iostream>
#include<string>
#include<queue>
using namespace std;

int main() {
	string s;
	while (getline(cin,s)) {
		if (s == "END OF INPUT")break;
		else {
			int sa=0;
			queue<int>q;
			for (int i = 0;i < s.size();i++) {
				if (s[i] != ' ')sa++;
				else {
					q.push(sa);
					sa = 0;
				}
			}
			q.push(sa);

			int b = q.size();

			for (int i = 0;i < b;i++) {
				cout << q.front();
				q.pop();
			}
			cout << endl;
		}
	}
	return 0;
}