import java.util.Scanner; public class No29 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int[] su = new int[10]; int lvUp = 0; int itemCount = 0; int n = sc.nextInt(); for(int i = 0; i < n * 3; i++){ int getItem = sc.nextInt(); itemCount++; // 同じアイテムが2つ揃う if(su[getItem - 1] == 1){ lvUp++; su[getItem - 1] = 0; itemCount -= 2; // 2つのアイテムを消費 }else{ su[getItem - 1]++; } } System.out.println(lvUp + (int)itemCount / 4); sc.close(); } }