#include<bits/stdc++.h> using namespace std; int main() { //freopen("title.in","r",stdin); //freopen("title.out","w",stdout); int n=0; string str; getline(cin,str); int j=str.length(); for(int i=0;i<j;i++) if(str[i]==' '||str[i]=='\n') n++; cout<<n<<endl; return 0; }