from collections import defaultdict n = int(input()) cnt = 0 d = defaultdict(int) for _ in range(n): a, b, c = map(int, input().split()) d[a] += 1 d[b] += 1 d[c] += 1 for k, v in d.items(): cnt += v // 2 d[k] = v % 2 p = 0 for k, v in d.items(): p += v cnt += p // 4 print(cnt)