
while True:
    try:
        listA = map(str,raw_input().split(' '))
        listB = map(str,raw_input().split(' '))

        hit=0
        blw=0
        for tB in listB:
            if (tB in listA) and (listB.index(tB) == listA.index(tB)):
                hit += 1
            elif (tB in listA) and (listB.index(tB) != listA.index(tB)):
                blw += 1
        print hit,blw

    except EOFError:
        break