Q = int(input()) V = set() E = set() F = set() for _ in range(Q): a,b,c = map(int,input().split()) V.add(a) V.add(b) V.add(c) E.add((a,b)) E.add((a,c)) E.add((b,c)) F.add((a,b,c)) print(len(V)-len(E)+len(F))