while True:
    try:
        hit = 0
        brow = 0
        Anum = list(map(int,input().split()))
        Bnum = list(map(int,input().split()))
        for i in range(4):
            if Anum[i] == Bnum[i]:
                hit += 1
            elif Bnum[i] in Anum:
                brow +=1
        print(hit,brow)
                
                       
    except EOFError:
        break