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