import sys

def calc(listA, listB):
    hit = 0
    for i, j in zip(listA, listB):
        if i == j:
            hit += 1
    brow = len(set(listA) & set(listB))
    return (hit, brow-hit)

listA = list()
listB = list()

for i, line in enumerate(sys.stdin.readlines()):
    line = line.strip()
    if i % 2 == 0:
        listA = map(int, line.split())
    else:
        listB = map(int, line.split())
        print "{0:d} {1:d}".format(*calc(listA, listB))