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