import sys

alist = []
blist = []
cnt = 0

for line in sys.stdin:
	if cnt%2 == 0: alist.append(map(int, line.split()))
	else: blist.append(map(int, line.split()))
	cnt += 1

for i in range(0, len(alist)):
	a = alist[i]
	b = blist[i]
	hitcount = 0
	blowcount = 0
	for j in range(0, 4):
		if a[j] == b[j]: hitcount += 1
	for j in range(0, 4):
		for k in range(0, 4):
			if a[j] == b[k] and j != k: blowcount += 1
	print str(hitcount)+' '+str(blowcount)
