def x(m,n):
    H = 0
    B = 0
    for i in range(4):
        if m[i] == n[i]:
            H += 1
        else:
            if m[i] in n:
                B += 1
    return(H, B)

while True:
    try:
        a = list(map(int, input().split()))
        b = list(map(int, input().split()))
        print(*x(a, b))
    except:
        break
