// Aizu Vol-10 1042: Yes, I have a number
// 2017.8.17

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

char *gets();
char buf[1000], *p;

int main(void)
{
	int w;
	
	while (1) {
		gets(p = buf);
		if (!strcmp(buf, "END OF INPUT")) break;
		while (*p) {
			w = 0;  while (isspace(*p)) w++, p++;
			while (w > 1) putchar('0'), w--;
			if (!*p) break;
			w = 0;	while (isalpha(*p)) w++, p++;
			putchar('0' + w);
		}
		putchar('\n');
	}
	return 0;
}