#include <bits/stdc++.h>
using namespace std;

int main() {
  int n;
  cin >> n;
  vector<int> v(3);
  set<vector<int>> s;
  for (int i = 0; i < n; i++) {
    cin >> v[0] >> v[1] >> v[2];
    sort(v.begin(), v.end());
    s.insert(v);
  }
  cout << n - s.size() << "\n";
}
