#include using namespace std; int main(void) { int n; cin >> n; map mp; for (int i = 0; i < n; i++) { int a, b, c; cin >> a >> b >> c; mp[a]++; mp[b]++; mp[c]++; } int ans = 0, rem = 0; for (auto i : mp) { ans += i.second / 2; rem += i.second % 2; } ans += rem / 4; cout << ans << endl; return 0; }