#include <bits/stdc++.h>
using namespace std;
bool a(char c)
 {
     return ('A'<= c && c <= 'Z') || ('a' <= c && 'z' >= c);
 }
string s;int n=0;
int main()
{
	freopen("DEMTU.INP","r",stdin);
	freopen("DEMTU.OUT","w",stdout);
	getline(cin,s);
	for (int i=0;i<s.size()-1;i++)
	{
		if (s[i]==' '&&a(s[i+1]))
		{
			n++;
		}
	}
	cout<<n+1;
}
