N = int(input()) LI = [] for i in range(0,N) : a,b,c = map(int,input().split()) LI.append(a) LI.append(b) LI.append(c) ansA = 0 ansB = 0 for i in range(1,11) : number = int(LI.count(i)) ansAi = number // 2 ansBi = number % 2 ansA += ansAi ansB += ansBi print(ansA + ansB//4)