import sys
readline = sys.stdin.readline
write = sys.stdout.write
def solve():
    *A, = map(int, readline().split())
    *B, = map(int, readline().split())
    v1 = v2 = 0
    for i in range(4):
        if A[i] == B[i]:
            v1 += 1
        for j in range(4):
            if i != j and A[i] == B[j]:
                v2 += 1
    write("%d %d\n" % (v1, v2))
try:
    while 1:
        solve()
except:
    ...

