while 1:
	try:
		a = map(int,raw_input().split())
		b = map(int,raw_input().split())
		c,d = 0,0
		for i in enumerate(b):
			if i[1] in a:
				if a[i[0]] == i[1]:
					c += 1
				else:
					d += 1
		print c,d
	except:
		exit()