#include<iostream>
#include<map>
#include<sstream>
#include<string>
#include<algorithm>
using namespace std;

const int tablesize = 3000;

int main(){

    int n,p[3],count,psum;
    map<string,int> mp;
    const int defaultnum = mp["d"];
    int ok= (defaultnum == 10) ? 0 : 10;



    count = 0;

    cin >> n;

    for(int i=0;i<n;i++){
      cin >> p[0] >> p[1] >> p[2];
      sort(p,p+3);
      psum = p[0] + p[1] + p[2];
      string keystring="";
      stringstream ss;
      for(int j=0;j<3;j++){
        ss << p[j];
      }

      ss >> keystring;

      if(mp[keystring] == ok){
        count++;
      }
      else{
        mp[keystring] = ok;
      }

    }

    cout << count << endl;

    return 0;
}