#include <stdio.h>
#include <string.h>

int main(void)
{
	char str[1000];
	int n;
	int count;
	
	while (1){
		fgets(str, 1000, stdin);
		
		str[strlen(str) - 1] = ' ';
		
		if (strcmp("END OF INPUT ", str) == 0){
			break;
		}
		
		n = 0;
		while (str[n] != '\0'){
			count = 0;
			while (str[n] != ' '){
				count++;
				n++;
			}
			n++;
			printf("%d", count);
		}
		printf("\n");
	}
	
	return (0);
}