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