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