fun main(args: Array<String>) {
    val (N, L1) = readLine()!!.split(" ").map(String::toInt)
    val L2 = N + L1 - 1
    if (L1 * L2 < 0) {
        println((L1..L2).sum())
    } else if (L2 <= 0) {
        println((L1 until L2).sum())
    } else {
        println((L1 + 1..L2).sum())
    }
}