while 1:
    try:
        a=map(int,raw_input().split())
        b=map(int,raw_input().split())
        hi=0
        bl=0
        for i in xrange(4):
            for j in xrange(4):
                if i==j:
                    if a[i]==b[j]:
                        hi+=1
                else:
                    if a[i]==b[j]:
                        bl+=1
        print hi,bl
    except:
        break