#include using namespace std; using ll = long long; int a[334], N, p, b; int main() { int ans = 0; cin >> N; b = 3 * N; for (int i = 0; i < 3 * N; i++) { cin >> p; a[p]++; if (a[p] == 2) ans++, a[p] -= 2, b -= 2; } cout << ans + b / 4 << endl; }