import java.util.Scanner; public class Main{ public static void main(String args[])throws Exception{ Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int[] item = new int[11]; for(int i=0;i<3*N;i++){ int I = sc.nextInt(); item[I]++; } int ans = 0; int amari = 0; for(int i=1;i<=10;i++){ ans += item[i]/2; amari += item[i]%2; } ans += amari/4; System.out.println(ans); } }