#include <fstream>
#include <string.h>

using namespace std;

int main(){
   char s[100000];
   ifstream fi;
   fi.open("DEMTU.INP");
   fi>>s;
   fi.close();
   ofstream fo;
   fo.open("DEMTU.OUT");
   long long i=0,num=0;
   for (i=0;i<strlen(s);i++){if (s[i]==' '){num++;}}
   fo<<num;
}

