def main():

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

    distance = b - a

    high_a = sum(list(range(1, distance)))

    print((high_a - a))





if __name__ == '__main__':

    main()

def main():

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

    print((sum(list(range(1, b - a))) - a))





if __name__ == '__main__':

    main()

def main():
    a, b = list(map(int, input().split()))
    distance = b - a
    high_a = sum(list(range(1, distance)))
    print((high_a - a))


if __name__ == "__main__":
    main()

def main():
    a, b = list(map(int, input().split()))
    print((sum(list(range(1, b - a))) - a))


if __name__ == "__main__":
    main()

-    distance = b - a -    high_a = sum(list(range(1, distance))) -    print((high_a - a)) +    print((sum(list(range(1, b - a))) - a))