import sys import collections sys.setrecursionlimit(10 ** 8) input = sys.stdin.readline def main(): N = int(input()) ABC = [[int(x) for x in input().split()] for _ in range(N)] cnt = collections.Counter() for a, b, c in ABC: cnt[a] += 1 cnt[b] += 1 cnt[c] += 1 ans = 0 mod = 0 for k in cnt.keys(): ans += cnt[k] // 2 mod += cnt[k] % 2 print(ans + mod // 4) if __name__ == '__main__': main()