#include <bits/stdc++.h>
using namespace std;
int main() {
  vector<long long int> vec;
  int count = 0;
  long long int temp;
  cin >> temp;
  vec.push_back(temp);
  for (int i = 1; i < 4; i++) {
    int flag = 1;
    cin >> temp;
    for (int j = 0; j < vec.size(); j++) {
      if (temp == vec[j]) {
        count++;
        flag = 0;
        break;
      }
    }
    if (flag) vec.push_back(temp);
  }
  cout << count;
  return 0;
}
