import java.util.Scanner; public class no29{ public static void main(String... args){ Scanner scan = new Scanner(System.in); int n = scan.nextInt(); int res = 0,tmp; int array[] = new int[10]; for(int i = 0; i < n; i++){ for(int j = 0; j < 3; j++){ tmp = scan.nextInt(); array[tmp-1]++; if(array[tmp-1] == 2){ array[tmp-1] = 0; res++; } } } tmp = 0; for(int i = 0; i < 10; i++) tmp += array[i]; while(4 <= tmp){ tmp -= 4; res++; } System.out.println(res); } }