// vim: set ts=4 sw=4 et tw=80:

#include <stdio.h>
#include <ctype.h>
#include <stdbool.h>

int main() {
    int c;
    bool in_space = true;
    unsigned int w = 0;
    while ((c = getchar()) != EOF) {
        if (isspace(c)) {
            if (!in_space) {
                w++;
                in_space = true;
            }
        } else {
            in_space = false;
        }
    }
    printf("%u\n", w);
}
