while True:
    try:
        A = list(map(int, input().split()))
        B = list(map(int, input().split()))
        a = b = 0
        for i in range(4):
            if A[i] == B[i]:
                a+=1
            elif B[i] in A:
                b+=1
        print(a, b)
    except:
        break
