import java.util.*; public class Run { public static void main (String arg[]) { Scanner scan = new Scanner(System.in); int N = scan.nextInt(); if (N < 1||N > 100) System.exit(1); int a, b, c; int[] item = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; for (int i = 0; i < N; i++) { a = scan.nextInt(); b = scan.nextInt(); c = scan.nextInt(); if (!match(a,b,c)) System.exit(1); item[a-1]++; item[b-1]++; item[c-1]++; } int ev = 0; int left = 0; for (int i = 0; i < 10; i++) { if (item[i] > 1) { ev += item[i]/2; } left += item[i]%2; } ev += left/4; System.out.println(ev); } public static boolean match (int... args) { for (int i : args) { if (i < 1||i > 10) return false; } return true; } }