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

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