N = int(input()) ABCs = [list(map(int, input().split())) for i in range(N)] cnt = [0 for i in range(10)] for a in ABCs: cnt[a[0]-1] += 1 cnt[a[1]-1] += 1 cnt[a[2]-1] += 1 sum = 0 res = 0 for c in cnt: sum += c // 2 res += c % 2 sum += res // 4 print(sum)