#include int main() { int n, a, b, c, cnt[10] = {}, cnt2 = 0, sum = 0, i; scanf("%d", &n); for (i = 0; i < n; i++) { scanf("%d %d %d", &a, &b, &c); cnt[a - 1]++; cnt[b - 1]++; cnt[c - 1]++; } for (i = 0; i < 10; i++) { sum += cnt[i] / 2; cnt2 += cnt[i] % 2; } printf("%d\n", sum + cnt2 / 4); return 0; }