#include<bits/stdc++.h>
using namespace std;
int main(){
  string s;
  while(getline(cin,s),s!="END OF INPUT"){
    for(int i=0,n=0,l=s.size();i<=l;i++){
      if(i==l||s[i]==' '){cout<<n;n=0;}
      else n++;
    }cout<<endl;
  }
}