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

void split(string& str, vector<string>& v){
  string::size_type index_space = str.find_first_of(" ");
  if(index_space!=string::npos){
    v.emplace_back(str.substr(0,index_space));
    string s(str.substr(index_space+1));
    split(s, v);
  }else{
    v.emplace_back(str);
  }
  return;
}

int main(){
  while(true){
    string str; getline(cin,str);
    if(str=="END OF INPUT") break;
    vector<string> v;
    split(str,v);

    for(int i=0;i<v.size();++i){
      if(v[i]==",") cout<<".";
      else cout<<v[i].size();
    }
    cout<<endl;
  }

  return 0;
}