n = int(input()) item = [0] * 14 for i in range(n): a, b, c = [ int(v) for v in input().split() ] item[a] += 1 item[b] += 1 item[c] += 1 total = sum([i // 2 for i in item]) total += sum([i % 2 for i in item]) // 4 print(total)