#include <bits/stdc++.h>
using namespace std;

map<tuple<int, int, int>, int> Map;
int N, A[3], E;

int main() {
    cin >> N;
    for (int i = 0; i < N; i++) {
        cin >> A[0] >> A[1] >> A[2];
        sort(A, A + 3);
        if (Map[make_tuple(A[0], A[1], A[2])] == 1) E++;
        Map[make_tuple(A[0], A[1], A[2])] = 1;
    }
    cout << E << endl;
    return 0;
}
