import sys
v = iter(sys.stdin.readlines())
for i, j in v, v:
    a, b = list(i.sprit()), list(j.split())
    k = len([n for n in a for m in b if n == m])
    l = len(set(a) & set(b))
    print(l, k-l)