#include <iostream>
#include <cstring>
using namespace std;
int main(){
char txt[150], cuv[15][10];
cin.get(txt,150);
//Imparte textul in cuvinte
char *p=strtok(txt," ");
int i=0;
while(p != NULL){
strcpy(cuv[i++],p);
p=strtok(NULL," ");
}
//Verifica cate cuvinte sunt identice cu ultimul cuvant
i--;
int nr=1;
for(int j=0;j<i;j++){
if(strcmp(cuv[i],cuv[j])==0) nr++;
}
//Afisare rezultat
cout << nr;
}