import scala.io.StdIn.readLine

object Main extends App {
  val Array(n, l) = readLine().split(' ').map(_.toInt)
  lazy val sum: Int = n * l + (1 until n).sum
  val result = (n, l) match {
    case (_n, _l) if _l > 0 =>
      sum - _l
    case (_n, _l) if _l <= 0 && _l > -_n =>
      sum
    case (_n, _l) =>
      sum - (_l + _n - 1)
  }
  println(result)
}