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

class Program
{
    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;
            HashSet<int> set = new HashSet<int>(); 
            for (int i = 0; i < 4; i++)
            {

                if (a[i] == b[i])
                {
                    hit++;
                    set.Add(i);
                }
            }
            int blow = 0;
            for (int i = 0; i < 4; i++)
            {
                for (int j = i + 1; j < 4; j++)
                {
                    if (set.Contains(i)) continue;
                    if (a[i] == b[j])
                    {
                        blow++;
                        
                    }
                }
            }
            Console.WriteLine(hit + " " + blow);
        }
    }
}