while True:
    try:
        A = list(map(int, input().split()))
        B = list(map(int, input().split()))
    except EOFError:
        break
    hit = sum(1 for i in range(4) if A[i] == B[i])
    blow = sum(1 for i in range(4) if A[i] in B) - hit
    print(hit, blow)