while True:
    try:
        A=list(map(int,input().split()))
        B=list(map(int,input().split()))
    except:
        break

    h=0
    for i in range(4):
        if A[i]==B[i]:
            h+=1
    b=0
    for i in A:
        if i in B:
            b+=1
    b-=h
    print(h,b)
