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

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

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

				int hit = 0;
				int blow = 0;

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

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

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

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

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