import java.util.Scanner;
class N029{
	public static void main(String args[]){
		Scanner s = new Scanner(System.in);
		int n = s.nextInt();
		int a[] = new int[10];
		for(int i = 0; i < n * 3; i++){
			int b = s.nextInt();
			a[b - 1]++;
		}
		
		int count = 0 , sum = 0;
		for(int i = 0; i < 10; i++){
			sum += a[i] / 2;
			if(a[i] % 2 == 1){
				count++;
			}
		}
		System.out.println(sum + count / 4);
	}
}