import java.util.*; public class Exercise145{ public static void main (String[] args){ Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int[] array = new int[11]; int a = 0; int h = 0; for(int i = 0; i < n * 3; i++){ array[sc.nextInt()]++; } for(int i = 1; i < 11; i++){ a += array[i] / 2; if(array[i] % 2 == 1){ h++; } } System.out.println(a + h / 4); } }