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

