fun main(args:Array<String>){
    val line = readLine()!!.split(" ").map{it.toInt()}
    val n = line[0]
    val l = line[1]
    val sum = (2*l + n - 1)*n/2
    val result = if(l>=0){
        sum-l
    }else{
        if(l+n-1>=0){
            sum - 0
        }else{
            sum - (l+n-1)
        }
    }
    println(result)
}