let n, l = Scanf.scanf " %d %d" @@ fun a b -> a, b
let base = n * (2 * l + n - 1) / 2
let d = ref max_int
let ans = ref 0
let _ =
  for i = 1 to n do
    let v = l + i - 1 in
    if !d > abs @@ base - (base - v) then (d := abs @@ base - (base - v); ans := base - v) done;
  Printf.printf "%d\n" !ans