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