from collections import defaultdict def main(): n = int(input()) d = defaultdict(int) for _ in range(n): a, b, c = map(int, input().split()) d[a] += 1 d[b] += 1 d[c] += 1 ans = 0 left = 0 for k, v in d.items(): ans += v // 2 left += v % 2 ans += left // 4 print(ans) if __name__ == '__main__': main()