# -*- coding: utf-8 -*- n = int(input()) items = [] score = 0 for i in range(n): temp = list(map(int, input().split())) for x in temp: if x in items: items.remove(x) score += 1 else: items.append(x) score += len(items) // 4 print(score)