#include <bits/stdc++.h>
using namespace std;
int main ()
{
   ifstream f("DEMTU.inp");
     char a[256];
     f.getline(a,256);
        int x,y,n,r,c=1; x=1;
    n=strlen(a);
    y=n;
     while (static_cast<int>(a[x])==32)
     x++;
     while (static_cast<int>(a[y])==32)
    y--;
     for (int b=x; b<=y;b++)
     {r=static_cast<int>(a[b]);
     if (r==32) c++;}
    f.close();
    ofstream f1("DEMTU.out");
     f1 <<c;
     f1.close();
}
