while True:
	try:
		a = map(int, raw_input().split())
		b = map(int, raw_input().split())
		hit = 0
		blow = 0
		for na, nb in zip(a, b):
			if na == nb: hit += 1
			if nb in a: blow += 1
		blow = blow - hit
		print "{} {}".format(hit, blow)
	except EOFError:
		break