while True:
    try:
        h=0
        b=0
        a1,a2,a3,a4=map(int,input().split())
        b1,b2,b3,b4=map(int,input().split())
        if a1==b1:
            h+=1
        if a2==b2:
            h+=1
        if a3==b3:
            h+=1
        if a4==b4:
            h+=1
        if a1==b2 or a1==b3 or a1==b4:
            b+=1
        if a2==b1 or a2==b3 or a2==b4:
            b+=1
        if a3==b1 or a3==b2 or a3==b4:
            b+=1
        if a4==b1 or a4==b2 or a4==b3:
            b+=1
        print(h,b)
    except:
        break
