#include <stdio.h>

#define TRUE	1
#define FALSE	0

int main() {
	char c;
	int np = 1;
	int car_ant_espai = FALSE;

	printf("Intro frase.\n");
	do {
		scanf("%c", &c);
		if (c != ' ' && car_ant_espai) {
			np++;
			car_ant_espai = FALSE;
		} else if (c == ' ') {
			car_ant_espai = TRUE;
		}

	} while (c != '\n');

	printf("Num paraules = %d.\n", np);
}

