
def Hit(an_list,bn_list):
    n = 0
    for a in enumerate(an_list):
        for b in enumerate(bn_list):
            if a == b:
                n +=1
    return n

def Blow(an_list,bn_list):
    n = 0
    for an in an_list:
        for bn in bn_list:
            if an == bn:
                n +=1
    return n

while True:
    try:
        [a1,a2,a3,a4] = map(int,raw_input().split())
        [b1,b2,b3,b4] = map(int,raw_input().split())
    except EOFError:
        break
    
    an_list = [a1,a2,a3,a4]
    bn_list = [b1,b2,b3,b4]
    hit = Hit(an_list,bn_list)
    blow = Blow(an_list,bn_list)
    
    print "%d %d" % (hit,blow-hit)