while 1:
    try:
        a = map(int, raw_input().split())
        b = map(int, raw_input().split())
        for i in xrange(3, -1, -1):
            if a[i] == b[i]:
                del a[i]
                del b[i]
        print str(4 - len(a)) + " " + str(len(set(a) & set(b)))
    except:
        break