def main(): N = int(input()) items = [0] * 10 lvup = 0 lvup_c = 0 for _ in range(N): a, b, c = map(int, input().split()) items[a - 1] += 1 items[b - 1] += 1 items[c - 1] += 1 for i in items: if i >= 2: lvup += (i // 2) elif i == 1: lvup_c += 1 lvup += (lvup_c // 4) print(lvup) if __name__ == '__main__': main()