let () =
    let main () =
        let n, l = Scanf.sscanf (read_line ()) "%d %d" (fun n l -> n, l) in
        let min_taste = l in
        let max_taste = l + n - 1 in
        let s =
            if min_taste > 0 then (n + 2 * l) * (n - 1) / 2 else
            if max_taste < 0 then (n + 2 * l - 2) * (n - 1) / 2 else
                                  n * (2 * l - 1 + n) / 2
        in
        Printf.printf "%d\n" s
    in
    main ()