while True:
    try:
        x = list(map(int,input().split()))
    except:
        break
    y = list(map(int,input().split()))
    h, b = 0, 0
    for i in range(4):
        if x[i] == y[i]:
            h += 1
        elif y[i] in x:
            b += 1
    print(h, b)