while True:
	try:
		a = list(map(int, input().split()))
		b = list(map(int, input().split()))
		hit = blow = 0
		for i in range(4):
			for j in range(4):
				if i == j and a[i] == b[j]: hit += 1
				if i != j and a[i] == b[j]: blow += 1
		print(hit, blow)
	except EOFError:
		break