N = int(input()) L = [0] * 11 for i in range(N): a, b, c = map(int, input().split()) L[a] += 1 L[b] += 1 L[c] += 1 ans = 0 for i in range(11): ans += L[i] // 2 L[i] %= 2 ans += sum(L) // 4 print(ans)