#include <bits/stdc++.h>
using namespace std;

string s;

int main() {
	ios::sync_with_stdio(0); cin.tie(0);
	int num = 1;
	getline(cin, s); // 공백이 있는 문자열 입력 시 사용

	if (s.empty()) 
	{
		cout << 0;
		return 0;
	}
	
	for (int i = 1; i < s.length() - 1; i++)
	{
		if (s[i] == ' ') {
			num++;
		}
	}

	cout << num;
}