N = int(input()) item_cnt = [0]*10 for _ in range(N): item = list(map(int,input().split())) for i in item: item_cnt[i-1] += 1 ans = 0 for i in range(10): power = item_cnt[i]//2 ans += power item_cnt[i] -= power*2 if item_cnt.count(1) >= 8: ans += 2 elif item_cnt.count(1) >= 4: ans += 1 print(ans)