object Main extends App {
  val List(n,k) = io.StdIn.readLine.split(" ").toList.map(_.toInt)

  var t = 0
  (k to n+1).foreach{i =>
    val min = (0 + (i-1))*i / 2
    val max = ( n + (n-i+1) )*i / 2
    t += max - min + 1
  }
  println(t)
}