using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace AOJ
{
    class Program
    {
        static void Main(string[] args)
        {
            string r1, r2;
            while((r1 = Console.ReadLine()) != null && (r2 = Console.ReadLine()) != null)
            {
                int hit = 0;
                int blow = 0;
                int[] a = getIntArray(r1.Split(' '));
                int[] b = getIntArray(r2.Split(' '));
                var dict = new Dictionary<int, bool>();
                for (int i = 0; i < 10; i++)
                    dict.Add(i, false);
                foreach (var i in a)
                {
                    dict.Remove(i);
                    dict.Add(i, true);
                }
                for(int i = 0; i < b.Length; i++)
                {
                    if (a[i] == b[i])
                        hit++;
                    else if (dict[b[i]]) blow++;
                }
                Console.WriteLine("{0} {1}", hit, blow);
            }
        }

        static int[] getIntArray(string[] splited)
        {
            var result = new List<int>();
            foreach (var v in splited)
            {
                result.Add(int.Parse(v));
            }
            return result.ToArray();
        }
    }
}