#define _CRT_SECURE_NO_WARNINGS
//#define _USE_MATH_DEFINES
#include<stdio.h>
//#include<stdlib.h>
//#include<math.h>
#include<string.h>
#define P(type,x) fprintf(stdout,"%"#type"\n",x)
int main() {
	char s[10000], *p;
	int c;
	while (fgets(s, sizeof(s), stdin)) {
		s[strlen(s) - 1] = '\0';
		if (strcmp(s, "END OF INPUT") == 0) break;
		p = s;
		c = 0;
		while (*p) {
			if (*p == ' ') fprintf(stdout, "%d", c), c = 0;
			else c++;
			p++;
		}
		P(d, c);
	}
	return 0;
}