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