import sys
f=0
for s in sys.stdin:
    f=1-f
    b=map(int,s.split())
    if f:
        a=b
        continue
    c1=0
    c2=0
    for i,e in enumerate(b):
        if e==a[i]: c1+=1
        elif e in a: c2+=1
    print c1, c2