#include <iostream>
#include <string>

using namespace std;

/** Application main entry point. */
int main (
  int     argc,
  char  * argv[ ]
  )
{
  for ( ; ; )
  {
    int           res = 0;
    string        s;
    const char  * p;

    getline ( cin, s );
    if ( s == "END OF INPUT" )  break ;

    for ( p = s.c_str ( ); *p != '\0'; ++p )
    {
      if ( isspace ( *p ) )
      {
        cout << res;
        res = 0;
      }
      else
      {
        ++res;
      }
    }
    cout << res << endl;
  }

  return ( 0 );
}