#include using namespace std; int N, a, b, c, i, x, y, I[11] = {}; int main() { cin >> N; while (N-- && cin >> a >> b >> c) I[a]++, I[b]++, I[c]++; for (int i = 1; i < 11; i++) x += I[i] / 2, y += I[i] % 2; cout << x + y / 4 << "\n"; }