while True:
    try:
        a=input().split()
        b=input().split()
        hit=0
        blow=0

        for i in range(4):
            for j in range(4):
                if(a[i]==b[i]):
                    hit+=1
                    break
                if(a[i]==b[j]):
                    blow+=1
                    break

        print(hit, blow)
        
    except EOFError:
        break
