//---------------------------------------------------------------------------
#include
int main(void)
{
char word[20];
int c=0;
do
{
scanf("%*[^a-zA-Z]%19[a-zA-Z]",word);
if (!word[1]) ++c;
}while (getchar()!='.');
printf("%d\n",c);
return 0;
}
//---------------------------------------------------------------------------