#include <fstream>
#include <iostream>
#include <string>
using namespace std;
int main()
{
    ifstream fi("demtu.inp");
    ofstream fo("demtu.out");
    string s;
    int d = 1;
    getline(fi,s);
    while (s[0] == 32) s.erase(0,1);
    while (s[s.length()-1] == 32) s.erase(s.length()-1,1);
    for (int i = 1; i < s.length()-1; i++)
    {
        if (s[i] == 32 && s[i+1] != 32) d++;
    }
    fo<<d;
    return 0;
}
