package me.yukicoder.lv1; import java.util.Scanner; public class No0029 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int[] items = new int[10]; // アイテムを格納 for (int i = 0; i < N * 3; i++) { int itemNum = sc.nextInt(); items[itemNum - 1] = items[itemNum - 1] + 1; } int upCnt = 0; int modCnt = 0; for (int i : items) { upCnt += i / 2; modCnt += i % 2; } upCnt += modCnt / 4; System.out.println(upCnt); } }