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

namespace _025_HitandBlow
{
	class Program
	{
		static void Main ( string[] args )
		{
			string inputStr1;

			while ((inputStr1 = Console.ReadLine ()) != null)
			{
				int[] hand1 = Array.ConvertAll (inputStr1.Split (' '), int.Parse);
				int[] hand2 = Array.ConvertAll (Console.ReadLine ().Split (' '), int.Parse);

				int hit = 0;
				int blow = 0;

				List<int> blow1 = new List<int> (4);
				List<int> blow2 = new List<int> (4);

				for (int index = 0; index < hand1.Length; index++)
				{
					if (hand1[index] == hand2[index])
					{
						hit++;
					}
					else
					{
						blow1.Add (hand1[index]);
						blow2.Add (hand2[index]);
					}
				}

				blow1.Sort ();
				blow2.Sort ();

				for (int index = 0; index < blow1.Count; index++)
				{
					if (blow1[index] == blow2[index])
					{
						blow++;
					}
				}

				Console.WriteLine (hit + " " + blow);
			}
		}
	}
}