ans = []
while True:
    try:
        a = map(int,raw_input().split())
    except EOFError:
        break
    b = map(int,raw_input().split())

    n = 0
    m = 0

    for i in range(4):
        if a[i] == b[i]:
            n += 1

    for i in range(0,4):
        for j in range(0,4):
            if a[i] == b[j]:
                m += 1
    m -= n

    ans.append(str(n)+' '+str(m))

for i in ans:
    print i