while True:
    try:
        Alst = list(map(int, input().split()))
        Blst = list(map(int, input().split()))
        H = 0
        B = 0

        for a, anum in enumerate(Alst):
            for b, bnum in enumerate(Blst):
                if anum == bnum:
                    if a == b:
                        H = H + 1
                    else:
                        B = B + 1

        print(str(H) + ' ' + str(B))


    except EOFError:
        break
