bag = [0] * 10 ans = 0 for i in range(int(input())): itm = list(map(int, input().split())) for j in range(3): bag[itm[j] - 1] += 1 for i in range(10): if(bag[i] // 2 > 0): ans += bag[i] // 2 bag[i] -= bag[i] // 2 * 2 print(ans + sum(bag) // 4)