import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int[] x = new int[11]; for(int i = 0 ; i < n ; i++) { int a = sc.nextInt(); int b = sc.nextInt(); int c = sc.nextInt(); x[a]++; x[b]++; x[c]++; } int ans = 0; int cnt = 0; for(int i = 0 ; i < 11 ; i++) { ans += x[i] / 2; cnt += x[i] % 2; } ans += cnt / 4; System.out.println(ans); } }