#include<iostream>
#include<string>
using namespace std;
int main(){
	string a;
	while(true){
		getline(cin,a);
		if(a=="END OF INPUT")
			break;
		int count=0;
		for(int i=0;i<a.size();i++){
			if(a[i]==' '){
				cout<<count;
				count=0;
			}
			else
				count++;
		}
		cout<<count<<endl;
	}
	return 0;
}