def main():

    a, b = list(map(int, input().split()))



    l = []

    for i in range(2, 1001):

        h = 0

        for j in range(1, i):

            h = h + j

        l.append(h)



    for i in range(len(l) - 1):

        if l[i] - a == l[i + 1] - b:

            print((l[i] - a))

            break





if __name__ == '__main__':

    main()

def main():

    a, b = list(map(int, input().split()))



    l = []

    for i in range(2, 1001):

        h = 0

        for j in range(1, i):

            h = h + j

        l.append(h)



    for i in range(len(l) - 1):

        if l[i] - a == l[i + 1] - b:

            print((l[i] - a))

            break





def main2():

    a, b = list(map(int, input().split()))

    x = b - a



    s = 0

    for i in range(1, x):

        s = s + i



    print((s - a))





if __name__ == '__main__':

    main2()

def main():
    a, b = list(map(int, input().split()))
    l = []
    for i in range(2, 1001):
        h = 0
        for j in range(1, i):
            h = h + j
        l.append(h)
    for i in range(len(l) - 1):
        if l[i] - a == l[i + 1] - b:
            print((l[i] - a))
            break


if __name__ == "__main__":
    main()

def main():
    a, b = list(map(int, input().split()))
    l = []
    for i in range(2, 1001):
        h = 0
        for j in range(1, i):
            h = h + j
        l.append(h)
    for i in range(len(l) - 1):
        if l[i] - a == l[i + 1] - b:
            print((l[i] - a))
            break


def main2():
    a, b = list(map(int, input().split()))
    x = b - a
    s = 0
    for i in range(1, x):
        s = s + i
    print((s - a))


if __name__ == "__main__":
    main2()

+def main2(): +    a, b = list(map(int, input().split())) +    x = b - a +    s = 0 +    for i in range(1, x): +        s = s + i +    print((s - a)) + + -    main() +    main2()