# Aizu Problem 0025: Hit and Blow
#
import sys, math, os

# read input:
PYDEV = os.environ.get('PYDEV')
if PYDEV=="True":
    sys.stdin = open("sample-input.txt", "rt")


def hit_and_blow(A, B):
    hit, blow = 0, 0
    for k in range(4):
        if A[k] == B[k]:
            hit += 1
        elif A[k] in B:
            blow += 1
    return hit, blow


while True:
    try:
        A = [int(_) for _ in input().split()]
    except EOFError:
        break
    B = [int(_) for _ in input().split()]
    hit, blow = hit_and_blow(A, B)
    print(hit, blow)