#include<iostream>
#include<string>
#include<algorithm>
#include<math.h>
#include<queue>
#include<set>
#include<map>
#include<random>
#include<functional>
#include<utility>

#define rep(i,n) for(int i=0; i<n; i++)
#define pb push_back
#define P pair<int, int>
#define PLI pair<ll, int>

using namespace std;

typedef long long ll;


int N;
set< vector<int> > sp;
vector<int> p(3);
int main() {
	cin >> N;
	rep(i, N) {
		cin >> p[0] >> p[1] >> p[2];
		sort(p.begin(), p.end());
		sp.insert(p);
	}

	cout << N - sp.size() << endl;

	return 0;
}

