#include <stdio.h>
#define NUM 5

int main(void) {
double a[NUM];
int count = 0;
int i, x, y;

for (i = 0; i < NUM; i++) {
if (scanf("%lf", &a[i]) != 1) {
return 1;
}
}
for (x = 0; x < NUM; x++) {
for (y = x + 1; y < NUM; y++) {
if (a[x] == a[y]) {
count++;
}
}
}

printf("%d\n", count);
    return 0;
}