#include using namespace std; #ifdef LOCAL #include "settings/debug.cpp" #define _GLIBCXX_DEBUG #else #define Debug(...) void(0) #endif #define rep(i, n) for (int i = 0; i < (n); ++i) using ll = long long; using ull = unsigned long long; int main() { int n; cin >> n; map cnt; rep(i, n) { int a, b, c; cin >> a >> b >> c; cnt[a]++, cnt[b]++, cnt[c]++; } int ans = 0; int c = 0; for (auto [k, v] : cnt) { ans += v / 2; c += v % 2; } ans += c / 4; cout << ans << endl; return 0; }