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)
			{
				string inputStr2 = Console.ReadLine ();

				int[] array1 = inputStr1.Split (' ').Select (str => int.Parse (str)).ToArray ();
				int[] array2 = inputStr2.Split (' ').Select (str => int.Parse (str)).ToArray ();

				List<int> hand1 = new List<int> (array1);
				List<int> hand2 = new List<int> (array2);

				int hit = 0;
				int blow = 0;

				for (int index = 3; index >= 0; index--)
				{
					if (hand1[index] == hand2[index])
					{
						hit++;
						hand1.RemoveAt (index);
						hand2.RemoveAt (index);
					}
				}

				hand1.Sort ();
				hand2.Sort ();

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

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