func readInts() -> [Int] {
    return readLine()!.split(separator: " ").map { Int($0)! }
}

func main() {
    let a = readInts() 
    let n = a[0]
    let l = a[1]
    let sum = l * n + n * (n - 1) / 2
    var dmin = Int.max
    var closest = 0
    for i in 0..<n {
        let tmp = sum - (l + i)
        let d = abs(sum - tmp)
        if d < dmin {
            dmin = d
            closest = tmp
        }
    }
    print(closest)
}

main()
