from math import *
PI = 3.1415926535898
while True:
	try:
		a = map(int, raw_input().strip().split(' '))
		b = map(int, raw_input().strip().split(' '))
		hit = 0
		blow = 0
		for i in range(len(a)):
			if a[i] == b[i]:
				hit += 1
			elif b.count(a[i]) > 0:
				blow += 1
		print "%d %d" % (hit, blow)
	except EOFError:
		break