while True:
	try:
		hit = 0 ; blow = 0
		a = map(int,raw_input().split(' ')) ; b = map(int,raw_input().split(' '))
		for x in xrange(0,4):
			if b[x] in a:
				if b[x]==a[x]: hit += 1
				else: blow += 1
			else: pass
		print hit,blow
	except: break