from collections import Counter N = int(input()) freq = Counter() for _ in range(N): a, b, c = map(int, input().split()) freq[a] += 1 freq[b] += 1 freq[c] += 1 ans = 0 for k, v in freq.items(): d, m = divmod(v, 2) ans += d freq[k] = m ans += sum(freq.values()) // 4 print(ans)