while 1:
    try:
    	hit=0
    	br=0
        a=map(int,raw_input().split())
        b=map(int,raw_input().split())
    	for i in xrange(4):
    		if a[i]==b[i]:
    			hit+=1
    		br+=a[i].count(b)
    	print hit,br
    except:
    	break