package m.shin; import java.util.Scanner; public class Con29 { public static void main(String[] args) { Scanner s = new Scanner(System.in); int N = s.nextInt() , count = 0; int[] item = new int[10]; for(int i = 0;i < 3*N;i++){ int k = s.nextInt(); item[k-1]++; if(item[k-1] == 2){ count++; item[k-1] = 0; } } s.close(); N = 0; for(int i = 0;i < 10;i++){ N += item[i]; } System.out.println(count + N / 4); } }