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