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

int main(){
	string s,t;
	while(getline(cin,s),s!="END OF INPUT"){
		while(~s.find("  "))s.replace(s.find("  "),2," 9=_=9 ");
		stringstream ss(s);
		while(ss>>t)cout << (t=="9=_=9"?0:t.length());
		cout << endl;
	}
}