import java.util.*;
 
public class Main {
  public static void main(String[] args) {
	Scanner in = new Scanner(System.in);
	int num = Integer.parseInt(in.next());
	int len = Integer.parseInt(in.next());
	in.close();
	int total = sum(num, len);
	int eat = len;
    if (len < 0) {
      eat = num <= len * (-1) ? len + num - 1 : 0;
    }
    int ans = total - eat;
    System.out.println(ans);
  }
  
  static int sum(int num, int len) {
    num--;
    if (num == 0) return len;
    return len + sum(num, len + 1);
  }
} import java.util.*; util.* java public class Main {
  public static void main(String[] args) {
	Scanner in = new Scanner(System.in);
	int num = Integer.parseInt(in.next());
	int len = Integer.parseInt(in.next());
	in.close();
	int total = sum(num, len);
	int eat = len;
    if (len < 0) {
      eat = num <= len * (-1) ? len + num - 1 : 0;
    }
    int ans = total - eat;
    System.out.println(ans);
  }
  
  static int sum(int num, int len) {
    num--;
    if (num == 0) return len;
    return len + sum(num, len + 1);
  }
} Main public static void main(String[] args) {
	Scanner in = new Scanner(System.in);
	int num = Integer.parseInt(in.next());
	int len = Integer.parseInt(in.next());
	in.close();
	int total = sum(num, len);
	int eat = len;
    if (len < 0) {
      eat = num <= len * (-1) ? len + num - 1 : 0;
    }
    int ans = total - eat;
    System.out.println(ans);
  } main {
	Scanner in = new Scanner(System.in);
	int num = Integer.parseInt(in.next());
	int len = Integer.parseInt(in.next());
	in.close();
	int total = sum(num, len);
	int eat = len;
    if (len < 0) {
      eat = num <= len * (-1) ? len + num - 1 : 0;
    }
    int ans = total - eat;
    System.out.println(ans);
  } Scanner in = new Scanner(System.in); in new Scanner(System.in) int num = Integer.parseInt(in.next()); num Integer.parseInt(in.next()) Integer.parseInt Integer in.next() in.next in int len = Integer.parseInt(in.next()); len Integer.parseInt(in.next()) Integer.parseInt Integer in.next() in.next in in.close() in.close in int total = sum(num, len); total sum(num, len) sum num len int eat = len; eat len if (len < 0) {
      eat = num <= len * (-1) ? len + num - 1 : 0;
    } len < 0 len 0 {
      eat = num <= len * (-1) ? len + num - 1 : 0;
    } eat = num <= len * (-1) ? len + num - 1 : 0 eat num <= len * (-1) ? len + num - 1 : 0 num <= len * (-1) num len * (-1) len (-1) 1 len + num - 1 len + num len num 1 0 int ans = total - eat; ans total - eat total eat System.out.println(ans) System.out.println System.out System System.out ans String[] args args static int sum(int num, int len) {
    num--;
    if (num == 0) return len;
    return len + sum(num, len + 1);
  } sum {
    num--;
    if (num == 0) return len;
    return len + sum(num, len + 1);
  } num-- num if (num == 0) return len; num == 0 num 0 return len; len return len + sum(num, len + 1); len + sum(num, len + 1) len sum(num, len + 1) sum num len + 1 len 1 int num num int len len public class Main {
  public static void main(String[] args) {
	Scanner in = new Scanner(System.in);
	int num = Integer.parseInt(in.next());
	int len = Integer.parseInt(in.next());
	in.close();
	int total = sum(num, len);
	int eat = len;
    if (len < 0) {
      eat = num <= len * (-1) ? len + num - 1 : 0;
    }
    int ans = total - eat;
    System.out.println(ans);
  }
  
  static int sum(int num, int len) {
    num--;
    if (num == 0) return len;
    return len + sum(num, len + 1);
  }
} public class Main {
  public static void main(String[] args) {
	Scanner in = new Scanner(System.in);
	int num = Integer.parseInt(in.next());
	int len = Integer.parseInt(in.next());
	in.close();
	int total = sum(num, len);
	int eat = len;
    if (len < 0) {
      eat = num <= len * (-1) ? len + num - 1 : 0;
    }
    int ans = total - eat;
    System.out.println(ans);
  }
  
  static int sum(int num, int len) {
    num--;
    if (num == 0) return len;
    return len + sum(num, len + 1);
  }
} Main
import java.util.*;
 
public class Main {
  public static void main(String[] args) {
	Scanner in = new Scanner(System.in);
	int num = Integer.parseInt(in.next());
	int len = Integer.parseInt(in.next());
	in.close();
	int total = sum(num, len);
	int eat = len;
    if (len < 0) {
      eat = num <= len * (-1) ? len + num - 1 : 0;
    }
    int ans = total - eat;
    System.out.println(ans);
  }
  
  static int sum(int num, int len) {
    num--;
    if (num == 0) return len;
    return len + sum(num, len + 1);
  }
}