import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main { public static void main(String[] args) { BufferedReader buff = new BufferedReader(new InputStreamReader(System.in)); try { int N = Integer.parseInt(buff.readLine()); int sum = N * 3; int[] num = new int[10]; for (int i = 0; i < N; ++i) { String[] box = buff.readLine().split(" "); for (int j = 0; j < box.length; ++j) { num[Integer.parseInt(box[j]) - 1]++; } } int ans = 0; for (int i = 0; i < 10; ++i) { if (num[i] >= 2) { ans += num[i] / 2; sum -= num[i] - (num[i] % 2); num[i] %= 2; } } if (sum >= 4) { ans += sum / 4; } System.out.println(ans); } catch (NumberFormatException e) { } catch (IOException e) { } } }