#include <iostream>
#include <stdlib.h>
using namespace std;
int main()
{
string a;
int counter;
int iswork;
while(getline(cin,a))
{
iswork=0;
counter=0;
for(int i=0;i<=a.length();i++)
{
if(a[i]>='a'&&a[i]<='z'||a[i]>='A'&&a[i]<='Z')
{
counter++;
}
else
{
if(counter>1)
{
iswork++;
counter=0;
}
else
{
counter=0;
}
}
//cout<<iswork<<endl;
}
cout<<iswork<<endl;
}
}