while True:
    try:
        alist = input().split()
        blist = input().split()
        hit = brow = 0
        
        for i in range(4):
            for j in range(4):
                if alist[i] == blist[j]:
                    if i == j:
                        hit += 1
                    else:
                        brow += 1
        print(hit,brow)
    except EOFError:
        break
