using System;


class AOJ
{

    public static void Main()
    {
        int[] a = new int[4];
        int[] b = new int[4];

        while (true)
        {

            string[] s1 = Console.ReadLine().Split(' ');
            if (s1 == null) break;

            string[] s2 = Console.ReadLine().Split(' ');
            if (s2 == null) break;

            for (int i = 0; i < 4; i++)
            {
                a[i] = int.Parse(s1[i]);
                b[i] = int.Parse(s2[i]);
            }

            int hit = 0, blow = 0;

            for (int i = 0; i < 4; i++)
            {

                if (a[i] == b[i])
                    hit++;

                for (int j = 0; j < 4; j++)
                {
                    if (i != j && a[i] == b[j])
                        blow++;
                }
            }

            Console.WriteLine("{0} {1}", hit, blow);
        }
    }
}