package me.yukicoder; import java.util.Scanner; /** * http://yukicoder.me/problems/1 */ public class YukiCoder29 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int[] items = new int[10]; for (int i = 0; i < n; i++) { for (int j = 0; j < 3; j++) { items[sc.nextInt() - 1]++; } } int diffs = 0; int num = 0; for (int item : items) { num += item / 2; diffs += item % 2; } num += diffs / 4; System.out.println(num); } }