while True:
    try:
        L1=map(int,raw_input().split(" "))
        L2=map(int,raw_input().split(" "))
        blow=0
        hit=0
        for i in range(4):
            if L1[i]==L2[i]:
                hit+=1
            elif L1[i] in L2:
                blow+=1
        print hit,blow
    except:
        break