N = int(raw_input()); count = [0] * 11 for i in range(0,N): A,B,C = map(int, raw_input().split()) count[A] += 1 count[B] += 1 count[C] += 1 ans = 0 tmp = 0 for j in count: ans += j/2 tmp += j%2 print ans + tmp/4