while True:
    try:
        a=[int(i) for i in input().split()]
        b=[int(i) for i in input().split()]
    except:break
    hit=sum([1 for i in range(4) if a[i]==b[i]])
    blow=8-len(set(a)|set(b))-hit
    print("{0} {1}".format(hit,blow))
