while True:
    try:
        A=list(map(int,input().split()))
        B=list(map(int,input().split()))
        C=[]
        for i in range(4):
            if B[i]==A[i]:
                C.append("h")
            elif B[i] in A:
                C.append("b")
            else:
                pass
        H=C.count("h")
        B=C.count("b")
        print(H,B)
    except:
        break
