
fun main(args: Array<String>) {
    val (N, L) = readLine()!!.split(" ").map { it.toInt() }

    val tastes = (1..N).map { L + it - 1 }
    val sum = tastes.sum()
    if (tastes.first() < 0 && tastes.last() < 0) {
        println(sum - tastes.last())
    } else if (tastes.first() > 0 && tastes.last() > 0) {
        println(sum - tastes.first())
    } else {
        println(sum)
    }
}