def process(A, B):
    hit, blow = 0, 0
    for a, b in zip(A, B):
        if a == b:
            hit += 1
        elif a in B:
            blow += 1
    return (hit, blow)

while True:
    try:
        A = input().split()
        B = input().split()
    except: break
    hit, blow = process(A, B)
    print(hit, blow)
