import java.util.Arrays; import java.util.Iterator; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); int N = in.nextInt(); int num[] = new int[10]; Arrays.fill(num, 0); for (int i = 0; i < N; i++) { int a, b, c; a = in.nextInt(); b = in.nextInt(); c = in.nextInt(); num[a - 1]++; num[b - 1]++; num[c - 1]++; } int ans = 0; for (int i = 0; i < 10; i++) { if (num[i] > 2) { ans += num[i] / 2; num[i] = num[i] / 2; } } int amari = 0; for (int i = 0; i < 10; i++) { if (num[i] != 0) { amari++; } } ans += amari / 4; System.out.println(ans); } }