//Normal #define _GLIBCXX_DEBUG #define ll long long #include using namespace std; using Graph = vector>; void print(auto a){ cout << a; } void prints(auto a){ cout << a << " "; } void prints(){ cout << " "; } void printl(auto a){ cout << a << endl; } void printl(){ cout << endl; } void fix(int n){ cout << fixed << setprecision(n); } int siz(string s){ return (int)s.size(); } int main(){ int N; cin >> N; map mp; for(int i = 0; i < N*3; i++){ int A; cin >> A; mp[A]++; } int ans = 0, sub = 0; for(auto p: mp){ ans += p.second/2; sub += p.second%2; } printl(ans+sub/4); return 0; }