import java.util.Arrays; import java.util.Scanner; public class Main{ public static void main(String[] args) { Scanner scan = new Scanner(System.in); int N = scan.nextInt(); // int []a = new int[N]; // int []b = new int[N]; // int []c = new int[N]; int []x = new int[3 *N]; for(int i = 0; i < 3 * N; i++) { x[i] = scan.nextInt(); } scan.close(); Arrays.sort(x); int temp = x[0]; int cnt1 = 1; int cnt2 = 0; int ans = 0; for(int i = 1; i < 3 * N; i++) { if(temp == x[i]) { cnt1 ++; }else { ans += cnt1 / 2; cnt2 += cnt1 % 2; temp = x[i]; cnt1 = 1; } } ans += cnt1 / 2; cnt2 += cnt1 % 2; ans += cnt2 / 4; System.out.println(ans); } }