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

int main()
{
	char seq[ 1000 ];
	int max = 0, len;

	while( scanf("%s", seq) == 1 )
	{
		len = strlen( seq );
		if( len > max )
		{
			max = len;
		}
	}
	printf("The longest sequence was %d aa long.\n", max);
}

