#include <bits/stdc++.h>
using namespace std;
int main() {
  int n = 4;
  set<int> levels;
  while (n--) {
    int x;
    cin >> x;
    levels.insert(x);
  }
  n = 4;
  cout << n - levels.size();
  return 0;
}
