#include <stdio.h>
#include <string.h>
#define LINE_MAX 1001

int main(void){
	int len,c,lf,i,outc;
	int out[LINE_MAX];
	char str[LINE_MAX];
	while(1){
		i = 0;
		lf = 0;
		outc = 0;
		while(1){
			len = 0;
			while(1){
				c = getchar();
				str[i] = c == '\n' ? '\0' : c ;
				i++;
				if(c == ' '){
					out[outc] = len;
					outc++;
					break;
				}else if(c == '\n'){
					out[outc] = len;
					outc++;
					lf = 1;
					break;
				}else{
					len++;
				}
			}
			if(lf){break;}
		}
		if(!strcmp(str,"END OF INPUT")){
			break;
		}else{
			for(i = 0; i < outc; i++){
				printf("%d",out[i]);
			}
			putchar('\n');
		}
	}


	return 0;
}