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

namespace mondai0025
{
	class Program
	{
		static void Main(string[] args)
		{
			while( true ) {
				var	a_s	= Console.ReadLine();
				if( a_s == null ) {
					break;
				}
				var	b_s	= Console.ReadLine();
				var	a	= Array.ConvertAll( a_s.Split(), aa => int.Parse( aa ) );
				var	b	= Array.ConvertAll( b_s.Split(), bb => int.Parse( bb ) );
				
				int	hit		= 0;
				int	blow	= 0;
				for( int i = 0; i < a.Length; i++ ) {
					for( int j = 0; j < b.Length; j++ ) {
						if( a[ i ] == b[ j ] ) {
							if( i == j ) {
								hit++;
							} else {
								blow++;
							}
							break;
						}
					}
				}
				Console.WriteLine( hit + " " + blow );
			}
		}
	}
}