while True:
	try:
		s1 = raw_input()
		s2 = raw_input()
		a = map(int, s1.split())
		b = map(int, s2.split())
		hashMap = {}
		hit = 0
		blow = 0
		for i in range(len(a)):
			hashMap[a[i]] = i
		for i in range(len(b)):
			if b[i] in hashMap:
				if hashMap[b[i]] == i:
					hit += 1
				else:
					blow += 1
		print '%s %s' % (hit, blow)
	except (EOFError):
		break