import java.util.ArrayDeque; import java.util.Arrays; import java.util.Queue; import java.util.Scanner; public class Main { private int n; private int[] how; Main(){ how = new int[11]; } public void setN(int n){ this.n = n; } public void plusHow(int a,int b,int c){ this.how[a]++; this.how[b]++; this.how[c]++; } public int ans(){ int last = 0; int ans = 0; for(int i = 0;i < 10;i++){ ans += how[i] / 2; last += how[i] % 2; } ans += last / 4; return ans; } public static void main(String[] args) { Scanner sc = new Scanner(System.in); Main m = new Main(); int n = sc.nextInt(); m.setN(n); int a,b,c; for(int i = 0;i < n;i++){ a = sc.nextInt(); b = sc.nextInt(); c = sc.nextInt(); a--; b--; c--; m.plusHow(a, b, c); } System.out.println(m.ans()); } }