#include<bits/stdc++.h>
using namespace std;
int main(){
  int i,n=0;
  char s[100];
  gets(s);
  for(i=0;i<strlen(s);i++)
  if((s[i]==' '&&s[i-1]!=' ')||(s[i]!=' '&&s[i+1]==' ')) n++;
  cout<<n;
  return 0;
}
/**************************************************************
	Problem: 1106
	User: wtq001
	Language: C++
	Result: Wrong Answer
****************************************************************/