try:
    while True:
        L=0
        M=0
        
        A=list(map(int,input().split()))
        B=list(map(int,input().split()))
        
        for i in range(4):
            if A[i]==B[i]:
                L+=1
            
            C=A.count(B[i])
            if C>=1:
                M+=1
                
        print(L,M-L)
        
except EOFError:
    pass
