while True:
    try:
        a=map(int,raw_input().split())
        b=map(int,raw_input().split())
        c1=0
        c2=0
        for i,e in enumerate(b):
            if e in a:
                if e==a[i]: c1+=1
                else: c2+=1
        print c1, c2
    except:
        break