#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <iostream.h>
int main(int argc, char* argv[])
{
char x[1000];
unsigned int i=0 ;
int n=0 ;
char flag=0;
cin.getline(x,255);
strcat(x," ");
for(i=0;i<strlen(x);i++)
{
if(((x[i]>='a')&&(x[i]<='z'))||((x[i]>='A')&&(x[i]<='Z')))
{ flag=1;}
else
{
if (flag==1 ) n++;
flag=0;
}
}
printf("%d\n",n);
getchar();
return 0;
}