#include using namespace std; struct PairHash { size_t operator()(const pair& p) const { return ((size_t)p.first) * 31ULL + (size_t)p.second; } }; struct TripleHash { size_t operator()(const tuple& t) const { auto [a, b, c] = t; size_t h1 = std::hash()(a); size_t h2 = std::hash()(b); size_t h3 = std::hash()(c); return h1 * 131ULL + h2 * 137ULL + h3; } }; int main(){ ios::sync_with_stdio(false); cin.tie(nullptr); int Q; cin >> Q; unordered_set V; unordered_set, PairHash> E; unordered_set, TripleHash> F; for (int i = 0; i < Q; i++){ int a, b, c; cin >> a >> b >> c; V.insert(a); V.insert(b); V.insert(c); E.insert({a, b}); E.insert({b, c}); E.insert({a, c}); F.insert({a, b, c}); } int ans = V.size() - E.size() + F.size(); cout << ans << endl; return 0; }