import sys

a = []
for line in sys.stdin:
    a.append(line)

time=0
for n in a:
    if time==0:
        Alist=n.split()
        time=1
    else:
        Blist=n.split()
        hit=0
        blow=0
        for i in range(4):
            if Blist[i]==Alist[i]:
                hit+=1
            else:
                if Blist[i] in Alist:
                    blow+=1
        time=0
        print hit,blow