import math N = int(input()) items = [] for i in range(N): items += list(map(int, input().split())) items_uniq = list(set(items)) n = 0 m = 0 d = dict([(i, 0) for i in items_uniq]) for i in range(N * 3): if d[items[i]] == 1: d[items[i]] = 0 n -= 1 m += 1 else: d[items[i]] = 1 n += 1 print(m + math.floor(n / 4))