#include <bits/stdc++.h>
using namespace std;
int main() {
  string a[5];
  int i, j, c = 0;
  cin >> a[0] >> a[1] >> a[2] >> a[3];
  for (i = 0; i < 3; i++)
    for (j = i + 1; j < 4; j++)
      if (a[i] == a[j]) a[i] = "{";
  for (i = 0; i < 4; i++)
    if (a[i] != "{") c++;
  cout << 4 - c;
  return 0;
}
