try:
    while True:
        a1,a2,a3,a4=map(int,input().split())
        b1,b2,b3,b4=map(int,input().split()) 
        h=0
        b=0
        if a1==b1:
            h+=1
        if a2==b2:
            h+=1
        if a3==b3:
            h+=1
        if a4==b4:
            h+=1
        A = [a1,a2,a3,a4]
        B = [b1,b2,b3,b4]
    
        for i in A:
            for j in B:
                if i == j:
                    b +=1
        b = b - h
        
        print(h,b)
except EOFError:
    pass

        
