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

int main(void)
{
	int i;
	int answer = 0;
	char data[1024];
	
	while(1){
		fgets(data, sizeof(data), stdin);
		if(strcmp(data,"END OF INPUT") == 0) break;
		
		
	for(i = 0; i < strlen(data)  ; i++){
		if(data[i] == ' ' || data[i] == '\n'){
			printf("%d", answer);
			answer = 0;
		}
		else{
			answer += 1;
		}
	}
	
	printf("\n");
	}

	return 0;
}