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[] hand1 = inputStr1.Split (' ').Select (int.Parse).ToArray ();
				int[] hand2 = inputStr2.Split (' ').Select (int.Parse).ToArray ();

				int hit = 0;
				int blow = 0;

				int[] blowArray1 = new int[4];
				int[] blowArray2 = new int[4];
				int blowLength = 0;

				for (int index = 0; index < hand1.Length; index++)
				{
					if (hand1[index] == hand2[index])
					{
						hit++;
					}
					else
					{
						blowArray1[blowLength] = hand1[index];
						blowArray2[blowLength] = hand2[index];
						blowLength++;
					}
				}

				Array.Sort (blowArray1, 0, blowLength);
				Array.Sort (blowArray2, 0, blowLength);

				for (int index = 0; index < blowLength; index++)
				{
					if (blowArray1[index] == blowArray2[index])
					{
						blow++;
					}
				}

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