using System;
using System.Linq;

namespace AOJ
{
    class Program
    {
        static void Main(string[] args)
        {
            while(Console.In.Peek() != -1)
            {
                var readLine = Console.ReadLine();
                if (readLine == null) break;
                var a = readLine.Split(' ').Select(int.Parse).ToArray();
                var b = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
                int c = 0;
                for(int i = 0; i < 4; i++)
                {
                    if (a[i] == b[i])
                        c++;
                }
                Console.WriteLine("{0} {1}",
                    c,
                    a.Intersect(b).Count() - c);
            }
        }
    }
}