#include "stdio.h"
int main()
{
	char a;
	int i = 0;
	
	while((a = getchar()) != EOF)
	{
		i += 1;
		if(a == ' ')
			i = 0;
	}
	printf("%d", i - 1);

	return 0;
}