import sys

for lineCnt, line in enumerate(sys.stdin):
    if lineCnt % 2 == 0:
        a = map(int, line.split(' '))
        continue
    else:
        b = map(int, line.split(' '))
        
    hit = blow = 0
    for i, na in enumerate(a):
        if b[i] == na:
             hit += 1
        elif na in b:
            blow += 1
    print '%d %d' % (hit, blow)