#include <iostream>
#include <string>

using namespace std;

int main(){
  while(1){
    string in;
    getline(cin, in);
    if(in == "END OF INPUT") break;
    in += ' ';
    for(int i=0;i<in.size();i++){
      int cnt = 0;
      for(int j=i;j<in.size();j++){
	if(in[j] == ' '){
	  i = j;
	  break;
	}
	cnt++;
      }
      cout << cnt;
    }
    cout << endl;
  }
  return 0;
}