while True:
    try:
        data1 = list(map(int, input().split()))
        #print(data1)
        data2 = list(map(int,input().split()))
        #print(data2)
    except:
        break
    
    h = 0
    b = 0
    for i in range(4):
        try:
            if i == data1.index(data2[i]):
                h = h + 1
            else:
                b = b + 1
        except:
            pass
    print('{} {}'. format(h, b))
