using System; using System.Linq; using System.Collections.Generic; class AOJ { static void Main() { int n = int.Parse(Console.ReadLine()); int[] items = new int[11]; for (int i = 0; i < n; i++) { int[] acquired_items = Console.ReadLine().Split().Select(int.Parse).ToArray(); foreach (var elem in acquired_items) { items[elem]++; } } int cnt = 0; while (true) { bool power_up = false; for (int i = 1; i <= 10; i++) { if(items[i] >= 2) { cnt++; items[i] -= 2; power_up = true; } } if (power_up == false) { break; } } while (true) { bool power_up = false; List tmp = new List(); for (int i = 1; i <= 10; i++) { if(items[i] != 0) { tmp.Add(i); } } if(tmp.Count >= 4) { cnt++; for (int i = 0; i < 4; i++) { items[tmp[i]]--; } power_up = true; } if (power_up == false) { break; } } Console.WriteLine(cnt); } }