import java.util.Scanner; public class Main_yukicoder29 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int[] nn = new int[10]; for (int i = 0; i < n; i++) { for (int j = 0; j < 3; j++) { int a = sc.nextInt() - 1; nn[a]++; } } int ret = 0; int tmp = 0; for (int i = 0; i < 10; i++) { ret += nn[i] / 2; tmp += nn[i] % 2; } ret += tmp / 4; System.out.println(ret); sc.close(); } }