import sys
line=sys.stdin.readlines()
for A,B in zip(line[0::2],line[1::2]):
    a=map(int,A.strip().split())
    b=map(int,B.strip().split())
    hit,blow=0,0
    for i in xrange(4):
        if a[i]==b[i]:hit+=1
        elif a[i] in b : blow+=1
    print hit,blow