import sys
for i in sys.stdin:
    arrA,arrB = [],[]
    s = i.split()
    for i in s:
        arrA.append(int(i))
    s = input().split()
    for i in s:
        arrB.append(int(i))
    h,b = 0,0
    for i in range(len(arrA)):
        if arrA[i] == arrB[i]:
            h += 1
        else:
            if arrB.count(arrA[i]) > 0:
                b += 1
    print(h,b)