import sys

for user in sys.stdin:
    hit = 0
    blow = 0
    a = list(map(int, user.split()))
    user = input()
    b = list(map(int, user.split()))
    for i in range(4):
        for j in range(4):
            if b[i] == a[j]:
                if i == j:
                    hit += 1
                else:
                    blow += 1

    print(hit, blow)