while True:
    try:
        a = map(int, raw_input().split())
        b = map(int, raw_input().split())
        hit = 0; brow = 0
        for i in range(len(b)) :
            brow += a.count(b[i])
            if a[i] == b[i] :
                hit += 1
                brow -= 1
        print hit, brow

    except:
        break