#include<iostream>
#include<utility>
#include<queue>
#include<vector>
#include<algorithm>
using namespace std;
int main() {
	int N;
	cin >> N;
	priority_queue<pair<pair<int,int>,pair<int,int>>> q;
	int i;
	vector<int> p(3);
	for(i=0;i<N;i++) {
		cin >> p[0] >> p[1] >> p[2];
		sort(p.begin(),p.end());
		q.push(pair<pair<int,int>,pair<int,int>>(pair<int,int>(p[0],p[1]),pair<int,int>(p[2],i)));
	}
	p[0] = p[1] = p[2] = 0;
	int ans = 0;
	while(!q.empty()) {
		if(p[0] == q.top().first.first && p[1] == q.top().first.second && p[2] == q.top().second.first)ans++;
		p[0] = q.top().first.first;
		p[1] = q.top().first.second;
		p[2] = q.top().second.first;
		q.pop();
	}
	cout << ans << endl;
}
