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

class Program
{
    static bool[] used;
    static int[] cells;
    static int ans;
    static int[] nums;
    static void Main(string[] args)
    {
        string input;
        while ((input = Console.ReadLine()) != null)
        {
            string[] s = input.Split(' ');
            int[] a = new int[4];
            int[] b = new int[4];
            for (int i = 0; i < 4; i++)
            {
                a[i] = int.Parse(s[i]);
            }
            input = Console.ReadLine();
            s = input.Split(' ');
            for (int i = 0; i < 4; i++)
            {
                b[i] = int.Parse(s[i]);
            }
            int hit = 0;
            for (int i = 0; i < 4; i++)
            {
                if (a[i] == b[i]) hit++;
            }
            int blow=0;
            for (int i = 0; i < 4; i++)
            {
                for (int j = i+1; j < 4; j++)
                {
                    if (a[i] == b[j]) blow++;
                }
            }
            Console.WriteLine(hit + " " + blow);
        }
    }
}