#include <iostream>
#include <algorithm>
using namespace std;
int p[1005][3] = { 0 }, er[1005] = { 0 };
int main() {
	int n;
	cin >> n;
	for (int i = 0; i < n; i++) {
		int a, b, c, sum = 0;
		cin >> a >> b >> c;
		sum = a + b + c;
		p[i][0] = min(a, min(b, c));
		p[i][2] = max(a, max(b, c));
		p[i][1] = sum - p[i][0] - p[i][2];
	}
	for (int i = 0; i < n; i++) {
		if (er[i]==0) {
			for (int j = 0; j < n; j++) {
				if (i != j) {
					if (p[i][0] == p[j][0] && p[i][1] == p[j][1] && p[i][2] == p[j][2]) {
						er[j] = 1;
					}
				}
			}
		}
	}
	int ans = 0;
	for (int i = 0; i < n; i++) {
		if (er[i]) ans++;
	}
	cout << ans << endl;
	return 0;
}