import java.util.*; import java.math.*; import java.io.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int[] sum = new int[10]; for(int i = 0; i < n; i++) { for(int j = 0; j < 3; j++) { sum[sc.nextInt()-1]++; } } int ans = 0; int a = 0; for(int i = 0; i < 10; i++) { ans += sum[i] / 2; a += sum[i] % 2; } ans += a/4; System.out.println(ans); } }