while 1:
    try:
        A = input().split()
        B = input().split()
        hit = len([i for i in range(len(A)) if B[i] == A[i]])
        blow = len([i for i in range(len(A)) if B[i] in A]) - hit
        print(str(hit) + " " + str(blow))
    except:
        break
