import scala.io.StdIn

object Main extends App {
  val r = StdIn.readLine
  val s = r.split(" ")
  val a = s(0).toInt
  val b = s(1).toInt
  val result = (b - a) * (b - a + 1) / 2 - b
  println(result)
}