import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int ItemsTotal[] = new int[10]; for (int i = 0; i < n; i++) { int a = sc.nextInt(); int b = sc.nextInt(); int c = sc.nextInt(); ItemsTotal[a - 1]++; ItemsTotal[b - 1]++; ItemsTotal[c - 1]++; } int powerUp = 0; int other = 0; for (int i = 0; i < 10; i++) { if (ItemsTotal[i] >= 2) { powerUp += ItemsTotal[i] / 2; } other += ItemsTotal[i] % 2; } int maxPowerUp = (powerUp + other) / 4; //int maxPowerUp = other / 4; System.out.println(maxPowerUp); } }