import sys

while True:
    try:
        a = map(int, raw_input().strip().split())
        b = map(int, raw_input().strip().split())

        hit = 0
        blow = 0

        for i in xrange(len(b)):
            if b[i] in a:
                blow += 1
            if b[i] == a[i]:
                hit += 1

        blow -= hit

        print "%d %d" % (hit, blow)

    except EOFError:
        break