#include <iostream>
#include <cstring>
using namespace std;
int count(string s)
{
bool in_word = false;
int cnt = 0;
for (char c : s)
{
if (c == ' ')
{
in_word = false;
}
else
{
if (!in_word)
{
in_word = true;
cnt++;
}
}
}
return cnt;
}
int main()
{
string str;
getline(cin, str);
int cnt = count(str);
cout << cnt;
return 0;
}