N = int(input()) D = {} for i in range(1,11) : D[str(i)] = 0 for i in range(N) : a,b,c = map(int,input().split()) D[str(a)] += 1 D[str(b)] += 1 D[str(c)] += 1 ans = 0 for i in range(1,11) : ans += D[str(i)] // 2 D[str(i)] %= 2 ans += sum(list(D.values())) // 4 print(ans)