#include <iostream>
#include <string>
#include <sstream>
using namespace std;
signed main() {
string s;
getline(cin, s);
cout << distance(istream_iterator<string>(istringstream(s) >> ws), istream_iterator<string>());
return 0;
}
#include <iostream>
#include <string>
#include <sstream>
using namespace std;
signed main() {
string s;
getline(cin, s);
cout << distance(istream_iterator<string>(istringstream(s) >> ws), istream_iterator<string>());
return 0;
}