import sys
for line in sys.stdin:
    a = list(map(int, line.split()))
    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)

