#include<iostream>
#include<string>
#include<algorithm>

using namespace std;

int main(){
    string sentence;
    int count;

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

