using System;
using System.Linq;

namespace Volume0_0025
{
    class Program
    {
        static void Main(string[] args)
        {
            string input1;
            while( (input1 = Console.ReadLine() ) != string.Empty)
            {
                var nums1 = input1.Split(' ').Select(s => Convert.ToInt32(s)).ToList();
                var nums2 = Console.ReadLine().Split(' ').Select(s => Convert.ToInt32(s)).ToList();

                int hit = Enumerable.Range(0, 4).Where(i => nums1[i] == nums2[i]).Count();
                int blow = nums2.Where(i => nums1.Contains(i)).Count() - hit;
                Console.WriteLine(hit + " " + blow);
            }
        }
    }
}