using System;
using System.Linq;

namespace _0025
{
    class Program
    {
        static void Main(string[] args)
        {
            while (true)
            {
                string dajkldjkldas = Console.ReadLine();
                if (dajkldjkldas == null) { break; }
                int x = 0, y = 0;
                int[] a = dajkldjkldas.Split().Select(int.Parse).ToArray();
                int[] b = Console.ReadLine().Split().Select(int.Parse).ToArray();
                for (int i = 0; i < 4; i++)
                {
                    if (a[i] == b[i])
                    {
                        x++;
                    }
                    for (int k = 0; k < 4; k++) {
                        if (a[i] == a[k]) { y++; }
                    }
                }
                Console.WriteLine(x + " " + (y - x));

            }
        }
    }
}