#include <bits/stdc++.h>
using namespace std;
int main()
{
    //ifstream f1;
    //f1.open("DEMTU.INP");
    char s[256];
    int dem=0,n,i;
    cin.getline(s,256);
    n=strlen(s);
	if(s[0]!=' ')
		dem=1;
	for( i=0;i<n-1;i++)
	{
		if(s[i]==' ' && s[i+1]!=' ')
			dem++;
	}
	//f1.close();
	//ofstream f2;
	//f2.open("DEMTU.OUT");
    cout<<dem;
    //f2.close();
    return 0;
}
