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

    except:
        break