import sys

v = None
for i in sys.stdin:
    if v:
        h = 0
        for j, n in enumerate(i.split()):
            if n == v[j]:
                h += 10
            elif n in v:
                h += 1
        v = None
        print(h // 10, h % 10)
    else:
        v = i.split()