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

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            StringBuilder sb = new StringBuilder();

            string input1, input2;

            while (!string.IsNullOrEmpty(input1 = Console.ReadLine()))
            {
                input2 = Console.ReadLine();

                int[] A = Array.ConvertAll(input1.Split(' '), int.Parse);
                int[] B = Array.ConvertAll(input2.Split(' '), int.Parse);

                bool[] memo = new bool[10];
                int hit = 0, blow = 0;

                for (int i = 0; i < 4; i++)
                {
                    if (A[i] == B[i]) hit++;
                    else
                    {
                        if (memo[B[i]] == true) blow++;

                        memo[A[i]] = true;
                    }
                }
                sb.AppendLine(hit + " " + blow);
            }
            Console.Write(sb);
        }
    }
}