using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;

namespace yukicore
{
    internal class Program
    {
        private static void Main(string[] args)
        {

            int[] items = new int[10];
            Console.ReadLine();
            int ans = 0;
            int sum = 0;
            int now = 0;
            int next = 0;
            while (true)
            {
             
                var tmps = Console.ReadLine();
                if (tmps==null||tmps=="") break;
               
                var tmp = tmps.GetEnumerator();
                tmp.MoveNext();

                now = tmp.Current;
                tmp.MoveNext();
                next = tmp.Current;
                if (next - 49 < -1)
                {
                    items[now - 49]++;
                }
                else
                {
                    items[9]++;
                tmp.MoveNext();


                }

                tmp.MoveNext();


                now = tmp.Current;
                tmp.MoveNext();
                next = tmp.Current;
                if (next - 49 < -1)
                {
                    items[now - 49]++;
                }
                else
                {
                    items[9]++;
                    tmp.MoveNext();


                }

                tmp.MoveNext();


                now = tmp.Current;
              bool f=  tmp.MoveNext();
                if(f)
                    items[9]++;
                else
                    items[now - 49]++;
            
                
            }

            foreach (var item in items)
            {
                
                ans += items[item] >> 1;
                sum += items[item] & 0x1;
            }
            sum >>= 2;
            Console.WriteLine(ans + sum);
        }
    }


    
}