/*
#include <stdio.h>

enum { OUT = 0, IN = 1 };

int main () {
    int c, count = 0, state = OUT;

    while ((c = getchar()) != EOF)
        if (c == ' ' || c == '\t' || c == '\n')
            state = OUT;
        else if (state == OUT) {
            state = IN;
            ++count;
        } 
    printf("word count: %d\n", count);

    return 0;
}
*/

#include <stdio.h>

int main () {
    int c = ' ', count = 0;

    while (c != EOF) {
        while ((c=getchar()) != EOF && 
               (c==' ' || c=='\t' || c=='\n'))
            ;
        if (c == EOF) break;
        ++count;
        while ((c=getchar()) != EOF && c!=' ' && c!='\t' && c!='\n')
            ;
    }

    printf("word count: %d\n", count);

    return 0;
}

