#include <stdio.h>

int main() {
	char title = ' ';
	int times = 0;
	while (scanf("%c", &title) != -1) {
		if (title != ' ' && title != '\n') {
			times++;
		}
	}
	printf("%d", times);
	return 0;
}