import sys
while(True):
    try:
        hit=0
        blow=0
        a=[int(i) for i in input().split()]
        b=[int(i) for i in input().split()]
        for i in range(len(a)):
            for j in range(len(b)):
                if a[i]==b[j]:
                    if i==j:
                        hit+=1
                    else:
                        blow+=1
                    break
        print(hit,blow)
    except EOFError:
        sys.exit()
        