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

namespace AOJ
{
	class Program
	{
		static void Main(string[] args)
		{
			string s1 = "", s2 = "";
			while (((s1 = Console.ReadLine()) != null) && ((s2 = Console.ReadLine()) != null))
			{
				var a = s1.Split(' ').Select(i => int.Parse(i)).ToArray();
				var b = s2.Split(' ').Select(i => int.Parse(i)).ToArray();
				int hit = 0, blow = 0;
				for (int i = 0; i < 4; i++)
				{
					if (a[i] == b[i])
					{
						hit++;
						continue;
					}
					for (int j = 0; j < 4; j++)
					{
						if (a[i] == b[j])
						{
							blow++;
						}
					}
				}
				Console.WriteLine("{0} {1}", hit, blow);
			}
		}
	}
}