import sys
count = 0
for line in sys.stdin:
    if count % 2 == 0:
        a = list(map(int, line.split()))
    else:
        b = list(map(int, line.split()))
        hit, brow = 0, 0
        for i in range(4):
            if a[i] == b[i]:
                hit += 1
            elif a[i] in b:
                brow += 1
        print(hit, brow)
    count += 1

