using System; class Program { static void Main() { int n = int.Parse(Console.ReadLine()); string s = ""; int up = 0; for(int i=0;i< n; i++) { string[] str = Console.ReadLine().Split(); for(int j = 0; j < 3; j++) { if (str[j] == "10") str[j] = "0"; } s += str[0] + str[1] + str[2]; } for(int i = 0; i <= 9; i++) { int t = s.Length - s.Replace(i.ToString(), "").Length; if (t > 1) up += t / 2; } up += (s.Length - up * 2) / 4; Console.WriteLine(up); } }