import sys

turn = -1
for line in sys.stdin:
    turn += 1
    if turn%2 == 0:
        A = map(int, line.rstrip().split())
        continue
    else:
        B = map(int, line.rstrip().split())

    hit, blow = 0, 0
    for i, b in enumerate(B):
        if A[i] == b:
            hit += 1
        elif b in A:
            blow += 1
    print hit, blow