while True:
    try:
        a=list(map(int,input().split()))
        b=list(map(int,input().split()))
        hit,blow=0,0
        ac=0
        for i in a:
            bc=0
            ac +=1
            for j in b:
                bc +=1
                if i==j:
                    if ac==bc:
                        hit +=1
                    else:
                        blow +=1
        print(hit,blow)
    except:break
