fun main(args:Array<String>){
    val (n,l) = readLine()!!.split(" ").map{it.toInt()}
    val a = Array<Int>(n){0}
    for(i in 0 until n){
        a[i] = l + i
    }
    val sum = a.sum()
    var ans = 100000
    var mi = 100000
    for(i in 0 until n){
        if(Math.abs(a[i]) < mi){
            ans = sum - a[i]
            mi = Math.abs(a[i])
        }
    }
    println(ans)
}
