#include <iostream>
#include <vector>
#include <algorithm>
#define mp make_pair
using namespace std;

typedef pair<int,int> P;
typedef pair<int,P> PP;

int main(){
	int n;
	vector<PP> vec;
	cin >> n;
	for(int i = 0;i < n;i++){
		int a[3];
		cin >> a[0] >> a[1] >> a[2];
		sort(a,a + 3);
		vec.push_back(mp(a[0],mp(a[1],a[2])));
	}
	sort(vec.begin(),vec.end());
	vec.erase(unique(vec.begin(),vec.end()),vec.end());
	cout << n - vec.size() << endl;
	return 0;
}