# -*- coding: utf-8 -*- N =input() item = [0] * 10 for i in range(N): tmp = map(int, raw_input().split()) for j in range(3): item[tmp[j]-1] += 1 cnt1 = 0 cnt2 = 0 for i in range(10): cnt1 += item[i] // 2 cnt2 += item[i] % 2 print cnt1 + cnt2 // 4