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++) { if(x[i] >= 2) { ans += x[i] / 2; if(x[i] % 2 == 1) cnt++; } else if(x[i] == 1 || x[i] % 2 == 1) { cnt++; } } ans += cnt / 4; System.out.println(ans); } }