import java.lang.Math.abs

fun main(args: Array<String>) {
    val input = readLine()!!.split(" ")
    val n = input[0].toInt()
    val l = input[1].toInt()
    var eat = 0
    if (!(l <= 0 && n + l - 1 >= 0)){
        eat = if (abs(l) > abs(n + l - 1)) n + l - 1 else l
    }
    print((n + l ) * (n + l - 1) / 2 - l * (l - 1) / 2 - eat)
}