#include <bits/stdc++.h>
using namespace std;
int main ()
{
   freopen ("DEMTU.INP","r",stdin);
   freopen ("DEMTU.OUT","w",stdout);
     string a;
     getline(cin,a);
        int x,yn,r,c=1; x=1; y=n;
    n=a.length();
     while (1==1)
     {
         r=static_cast<int>(a[x]);
         if (r==32) x++; else break;
     }
     whie (1==1)
     {
         r=static_cast<int>(a[y]);
         if (r==32) y--; else break;
     }
     for (int b=x; b<=y;b++)
     {r=static_cast<int>(a[b]);
     if (r==32) c++;}
     cout <<c;
}
