import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main { public static void main(String[] args) throws IOException { BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); int N = Integer.parseInt(reader.readLine()); int[] items = new int[10]; String[] line; for (int i = 0; i < N; i++) { line = reader.readLine().split(" "); for (int j = 0; j < 3; j++) { items[Integer.parseInt(line[j]) - 1] += 1; } } int powerUpTimes = 0; int fourItemsLevelUpCounter = 0; for (int i = 0; i < 10; i++) { while (items[i] >= 2) { items[i] -= 2; powerUpTimes += 1; } if (items[i] == 1) { fourItemsLevelUpCounter += 1; } } powerUpTimes += (fourItemsLevelUpCounter / 4); System.out.println(powerUpTimes); } }