n = int(input())
z = [int(x) for x in input().split()]
z.sort(reverse = True)
available = 0
previous = 0
result = 0
for skill in z:
    available += 1
    if skill == previous and available >= 4:
        result += 1
        available -= 4
        previous = 0
    else:
        previous = skill
print(result)
