#include<bits/stdc++.h>
using namespace std;
ifstream fi("DEMTU.inp");
ofstream fo("DEMTU.out");
int main(){
string s;
std:getline(fi,s);

for(int i=0;i<s.length();++i)while(s[i]==' ' && s[i+1]==' ')s.erase(i,1);
if(s[0]==' ')s.erase(0,1);
if(s[s.length()-1]==' ')s.erase(s.length()-1,1);

int ans=1;
for(int i=0;i<s.length();++i)if(s[i]==' ')ans++;
fo<<ans;
}
