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

int main(){
	int n;
	string s;
	while( getline( cin , s ) , s != "END OF INPUT" ){
		n = 0;
		for(int i=0 ; i < (int)s.size() ; i++ ){
			if( i == (int)s.size()-1 ){
				cout << (n+1) << endl;
			}else if( s[i] == ' ' ){
				cout << n;
				n = 0;
			}else{
				n++;
			}
		}
	}
}