package yukicoder; import java.util.Scanner; public class Yuki29 { public static void main(String[] args) { int item[] = new int[10]; Scanner scan = new Scanner(System.in); int mob_count = scan.nextInt(); int getItem_arr[][] = new int[mob_count][3]; for (int i = 0; i < mob_count; i++) { for (int j = 0; j < 3; j++) { getItem_arr[i][j] = scan.nextInt(); item[getItem_arr[i][j] - 1 ]++; } } scan.close(); int power_up = 0; int remain_item = 0; for(int i = 0; i < 10; i++) { //System.out.println(item[i]); power_up += item[i]/2; remain_item += item[i]%2; } remain_item /= 4; System.out.println(power_up + remain_item); } }