if __name__ == '__main__':

	while True:
		try:
			A = input().split()
			B = input().split()

			hit = 0
			blow = 0
			for i in range(4):
				if A[i] == B[i]:
					hit += 1
				else:
					if B[i] in A:
						blow += 1

			print(hit,blow)

		except EOFError:
			break

