while True:
	try:
		a = list(map(int, input().split()))
		b = list(map(int, input().split()))
	except:
	    break
	
	h = 0
	bl = 0
	
	for i in range(4):
            if a[i] == b[i]:
                h += 1
                b[i] = 51
	for i in range(4):
            if a[i] in b:
                bl += 1
	 
	print(h,bl)

