(require '[clojure.string :as str])

(let [[a b] (map #(Integer/parseInt %) (str/split (read-line) #" "))
      tower-heigt (fn [n] 
                    (reduce + (range 1 (inc n))))]
  (println (- (tower-heigt (- b a)) b)))
