while True:
    hit=0
    bro=0
    try:
        a = [int(i) for i in input().split()]
        b= [int(j) for j in input().split()]
        for l in range(4):
            if a[l]==b[l]:
                hit+=1
        for g in range(4):
            for p in range(4):
                if a[g]==a[p]:
                    bro+=1
        bro=bro-hit
        bro-=1
        print(hit,bro)
    except:break

