import sys

state = True
for s in sys.stdin:
    if state:
        state = not state
        a = list(map(int,s.split()))
    else:
        state = not state
        b = list(map(int,s.split()))
        hit = 0
        for i in range(len(a)):
            if a [i] == b [i]:
                hit += 1
        blow = -hit
        for i in range(10):
            blow += min(a.count(i),b.count(i))
        print(hit,blow)