hoge = 0
while True:
	try:
		hit = 0
		blow = 0
		a = map(int, raw_input().split())
		b = map(int, raw_input().split())
		for i in range(4):
			try:
				if a.index(b[i]) == i:
					hit += 1
				else:
					blow += 1
			except ValueError:
				continue
		print hit, blow
	except EOFError:
		break
