#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

int main(){
  vector<vector<int>> sortedlist;
  int N;
  cin >> N;
  int p1,p2,p3;
  for(int i=0;i<N;i++){
    cin >> p1 >> p2 >> p3;
    vector<int> temp(3,0);
    temp.erase(temp.begin(),temp.end());
    temp.push_back(p1);
    temp.push_back(p2);
    temp.push_back(p3);
    sort(temp.begin(),temp.end());
    sortedlist.push_back(temp);
  }
  sort(sortedlist.begin(),sortedlist.end());
  sortedlist.erase(unique(sortedlist.begin(),sortedlist.end()),sortedlist.end());
  cout << N-sortedlist.size() << endl;
}

