#include <stdio.h>
#include <stdlib.h>
c;
int main(i)
{
  char s[99];
  for(;;printf("%d\n",c-1))
    {
      fgets(s,999,stdin); 
      if(strstr(s,"END OF INPUT"))
	exit(0);
      for(c=i=0;s[i]!='\0';c++)
	if(s[i++]==' ')
	  printf("%d",c),c=-1;
      
    }
  
}