while 1:
hit = blow = 0
try: a = [*map(int,input().split(' '))]
except: break
b = [*map(int,input().split(' '))]
for i in range(len(a)):
	if a[i] == b[i]:
		hit += 1
	if a[i] == b[i-1]:
		blow += 1
print(hit, blow)
