fun main(args: Array<String>) {
    val (n, l) = readLine()!!.split(' ').map(String::toInt)
    val sum = n * l + n * (n - 1) / 2
    println(if (-n < l && l <= 0) sum else (if (l < 0) sum - (l + n - 1) else sum - l))
}
