while True:
	try:
		A=[int(i) for i in input().split()]
		B=[int(i) for i in input().split()]
		#Hit
		hit=0
		for i in range(len(A)):
			if A[i]==B[i]:
				hit+=1
		#Blow
		blow=0
		for i in range(len(A)):
			for j in range(len(A)):
				if i!=j:
					if A[i]==B[j]:
						blow+=1

		print(hit,blow)



	except EOFError:
		break