open List
let i_inp_list : unit -> int list = fun () ->
  let inp_split = Str.split (Str.regexp " ") (input_line stdin) in
  map (fun x -> int_of_string x) (inp_split)
let () =
  let [n; l] = i_inp_list () in
  let last = n + l - 1 in
  let ans = 
    if last < 0 then
      (n - 1) * (l + last - 1) / 2
    else if l < 0 && last => 0 then
      n * (l + last) / 2
    else
      (n - 1) * (l + 1 + last) / 2
  in
  if n > 2 then
    print_int ans;
  else
    
  print_newline ()
      
