import java.util.Arrays; import java.util.LinkedList; import java.util.Scanner; public class Main { public static void main(String[] args){ Scanner sc = new Scanner(System.in); final int SIZE = 10; final int N = sc.nextInt(); int[] items = new int[SIZE]; for(int i = 0; i < N; i++){ final int a = sc.nextInt() - 1; final int b = sc.nextInt() - 1; final int c = sc.nextInt() - 1; items[a]++; items[b]++; items[c]++; } int answer = 0; for(int i = 0; i < SIZE; i++){ answer += items[i] / 2; items[i] %= 2; } int sum = 0; for(int i = 0; i < SIZE; i++){ sum += items[i]; } answer += sum / 4; System.out.println(answer); } }