import scala.io.{StdIn => in}

object Main extends App {
  val Array(n, l) = in.readLine.split(" ").map(_.toInt)
  val total = (1 to n).map(i => l+i-1).sum

  var res = 0
  for (i <- 1 to n) {
    var t=0
    for ( j <- 1 to n if j != i) {
      t += (l + j - 1)
    }
    if((total - res).abs > (total - t).abs) res = t
  }
  println(res)
}