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

int main(void)
{
	char str[2048];
	int i, c;
	
	while (1){
		fgets(str, 2048, stdin);
		
		if (strncmp(str, "END OF INPUT", 12) == 0){
			break;
		}
		
		i = 0;
		c = 0;
		while (1){
			if (str[i] == ' '){
				printf("%d", c);
				c = 0;
			}
			else if (str[i] == '\0'){
				printf("%d\n", c - 1);
				break;
			}
			else {
				c++;
			}
			i++;
		}
	}
	
	return (0);
}