object Main extends App {
  val input = io.StdIn.readLine().split(" ").map(_.toInt)
  val N = input(0)
  val L = input(1)

  val apples = (1 to N).toArray
  val tastes = apples.map { a => L + a - 1 }
  val totalTaste = tastes.sum
  // 全てが正の時→最小の整数
  // 正と負の時→最小の整数
  // 全てが負の時→最大の整数

  val result = if (tastes.head >= 0) tastes.tail.sum
  else if (tastes.last <= 0) tastes.init.sum
  else {
    var isFound = false
    tastes.foldLeft(scala.collection.mutable.ArrayBuffer.empty[Int]) { (acc, v) =>
      if (isFound) {
        acc += v
      } else {
        if (v >= 0) {
          isFound = true
          acc
        } else {
          acc += v
        }
      }
    }.sum
  }

  println(result)
}
