item_kind = [] power_up = 0 for i in range(10): item_kind.append(0) N = int(input()) for i in range(N): get_item = [int(x) for x in input().split()] for j in range(3): item_num = get_item[j] item_kind[item_num - 1] = item_kind[item_num - 1] + 1 for k in range(len(item_kind)): while item_kind[k] >= 2: item_kind[k] = item_kind[k] - 2 power_up = power_up + 1 power_up = power_up + int(item_kind.count(1) / 4) print(power_up)