import java.io.*; import java.util.*; import java.math.*; class Main29 { public static void out (Object out) { System.out.println(out); } public static void main (String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int ans = 0; int n = Integer.parseInt(br.readLine()); int[] nums = new int[3 * n]; for (int i = 0; i < n; i++) { String[] line = br.readLine().split(" "); for (int j = 0; j < line.length; j++) { nums[i * 3 + j] = Integer.parseInt(line[j]); } } Arrays.sort(nums); //System.out.println(Arrays.toString(nums)); for (int i = 1; i < nums.length; i++) { if (nums[i] == nums[i - 1]) { ans++; nums[i] = 0; nums[i - 1] = 0; } } //out(ans); out(ans + (3 * n - ans * 2) / 4); } }