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

namespace ConsoleApplication33
{
    class Program
    {
        static void Main()
        {
            while (true)
            {
                int x = 0, y = 0;
                string a = Console.ReadLine();
                if (a == null) break;
                string[] b = a.Split();
                string c = Console.ReadLine();
                if (c == null) break;
                string[] d = c.Split();
                for (int e = 0; e < 4; e++)
                {
                    if (b[e] == d[e])
                    {
                        x++;
                        for (int u = e; u < 4; u++)
                        {
                            try { b[u] = b[u+ 1]; }
                            catch { b[u] = "b"; }
                            try { d[u] = d[u + 1]; }
                            catch { d[u] ="a"; }
                        }
                    }
                }
                string[] k = new string[4 - x];
                for(int r = 0; r < 4 - x; r++)
                {
                    k[r] = b[r];
                }
                string[] q = new string[4 - x];
                for (int o = 0; o < 4 - x; o++)
                {
                    q[o] = d[o];
                }
                 for(int h = 0; h < 4 - x; h++)
                 {
                     for(int w = 0; w < 4 - x; w++)
                     {
                         if (k[h] == q[w]) y++;
                     }
                 }
                 Console.WriteLine(x+" "+y);                
            }
        }
    }
}