n = int(input()) lst = [0 for _ in range(11)] for _ in range(n): a, b, c = map(int, input().split()) lst[a] += 1 lst[b] += 1 lst[c] += 1 ans = 0 tmp = 0 for num in lst: ans += num // 2 tmp += num % 2 print(ans + tmp // 4)