while True:
    try:
        a=list(input())
        b=list(input())
        a=[i for i in a if i!=' ']
        b=[j for j in b if j!=' ']
        hit=blow=0
        for i in range(4):
            for j in range(4):
                if a[i]==b[j]:
                    if i==j:
                        hit+=1
                    else:
                        blow+=1
        print(hit,blow)
    except EOFError:
        break
