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