import scala.io.{StdIn => in}

object Main extends App {
  val Array(a, b) = in.readLine.split(" ").map(_.toInt)
  def rec(acc:Int, n:Int):Int = {
    if(n == 0) acc
    else rec(acc+n, n-1)
  }
  val ans =  rec(0,b-a) - b
  println(ans)
}