def check(collect, answer):
    hit = sum(1 for a, c in zip(answer, collect) if a is c)
    blow = len(set(collect) & set(answer)) - hit
    return (hit, blow)

while True:
    try:
        print(*check(input().split(), input().split()))
    except EOFError:
        break