import java.util.*

fun main(args: Array<String>) {
    val sc = Scanner(System.`in`)
    val n = sc.nextInt()
    val l = sc.nextInt()
    var result = 0
    var minabs = 10000000
    repeat(n) {
        result += l + it
        minabs = Math.min(Math.abs(l + it), minabs)
    }
    if (result < 0) {
        result += minabs
    } else {
        result -= minabs
    }
    println(result)
}