#include using namespace std; int main() { int n, itm[11] = {}; cin >> n; for (int i = 0; i < 3 * n; ++i) { int tmp; cin >> tmp; itm[tmp]++; } int res = 0; for (int i = 1, cnt = 0; i < 11; ++i) { res += itm[i] / 2; itm[i] %= 2 ; cnt += itm[i]; if (cnt == 4) { cnt = 0; res++; } } cout << res << endl; return 0; }