#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int main(void)
{
int N;
int KAZU=0; // 行う処理の回数
cin>>N;
vector < vector <int> > super;

for(int i=0;i<N;i++)
{
    int X,Y,Z;
    vector <int> a;
    cin>>X>>Y>>Z;
    a.push_back(X);
    a.push_back(Y);
    a.push_back(Z);
    sort(a.begin(),a.end());
    super.push_back(a);
}

sort(super.begin(),super.end());
super.erase(unique(super.begin(),super.end()),super.end());

cout<<N-super.size()<<endl;
}
