while True:
    try:
        a=input().split()
        b=input().split()
    except:
        break
    hit=0
    blow=0
    for i in range(4):
        x=a.count(b[i])
        blow+=x
        if a[i]==b[i]:
            hit+=1
            blow-=1
    print(hit,blow)
