import java.util.Arrays; import java.util.Scanner; public class Yukicoder29 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int[] item = new int[10]; Arrays.fill(item, 0); for (int i = 0; i < n * 3; i++) { item[sc.nextInt() - 1]++; } int res = 0, other = 0; for (int i = 0; i < 10; i++) { if (item[i] >= 2) { res += item[i] / 2; } other += item[i] % 2; } System.out.println(res + other / 4); } }