while True:
    try:
        hit = 0
        br = 0
        a = map(int,raw_input().split(' '))
        b = map(int,raw_input().split(' '))

        for i in range(4):
            for j in range(4):
                if a[i] == b[j]:
                    if i == j:
                        hit += 1
                    else:
                        br += 1

        print hit,br

    except EOFError:
        break