n = int(input()) counts = [0] * 11 # Using 1-based index for items 1-10 for _ in range(n): a, b, c = map(int, input().split()) counts[a] += 1 counts[b] += 1 counts[c] += 1 total_power = 0 # Calculate power-ups from pairs for i in range(1, 11): total_power += counts[i] // 2 counts[i] %= 2 # Calculate power-ups from remaining items (groups of four) remaining = sum(counts) total_power += remaining // 4 print(total_power)