battle = int(input()) items = [0]*11 powerUp = 0 option = 0 for i in range(battle): get_item = list(map(int, input().split())) for j in range(3): items[get_item[j]] += 1 for item in items: powerUp += int(item/2) item = item%2 option += item powerUp += int(option/4) print(powerUp)