import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ

		Scanner sc = new Scanner(System.in);

		int N = sc.nextInt();
		int A = sc.nextInt();

		int L = A;
		int R = A + N - 1;

		int eat;
		if (R <= 0) {
			eat = R;
		} else if (L >= 0) {
			eat = L;
		} else {
			eat = 0;
		}
		int ans = (R + L) * (R - L + 1) / 2 - eat;
		System.out.println(ans);
    }
}
   import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ

		Scanner sc = new Scanner(System.in);

		int N = sc.nextInt();
		int A = sc.nextInt();

		int L = A;
		int R = A + N - 1;

		int eat;
		if (R <= 0) {
			eat = R;
		} else if (L >= 0) {
			eat = L;
		} else {
			eat = 0;
		}
		int ans = (R + L) * (R - L + 1) / 2 - eat;
		System.out.println(ans);
    }
} Main public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ

		Scanner sc = new Scanner(System.in);

		int N = sc.nextInt();
		int A = sc.nextInt();

		int L = A;
		int R = A + N - 1;

		int eat;
		if (R <= 0) {
			eat = R;
		} else if (L >= 0) {
			eat = L;
		} else {
			eat = 0;
		}
		int ans = (R + L) * (R - L + 1) / 2 - eat;
		System.out.println(ans);
    } main {
		// TODO 自動生成されたメソッド・スタブ

		Scanner sc = new Scanner(System.in);

		int N = sc.nextInt();
		int A = sc.nextInt();

		int L = A;
		int R = A + N - 1;

		int eat;
		if (R <= 0) {
			eat = R;
		} else if (L >= 0) {
			eat = L;
		} else {
			eat = 0;
		}
		int ans = (R + L) * (R - L + 1) / 2 - eat;
		System.out.println(ans);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc int A = sc.nextInt(); A sc.nextInt() sc.nextInt sc int L = A; L A int R = A + N - 1; R A + N - 1 A + N A N 1 int eat; eat if (R <= 0) {
			eat = R;
		} else if (L >= 0) {
			eat = L;
		} else {
			eat = 0;
		} R <= 0 R 0 {
			eat = R;
		} eat = R eat R if (L >= 0) {
			eat = L;
		} else {
			eat = 0;
		} L >= 0 L 0 {
			eat = L;
		} eat = L eat L {
			eat = 0;
		} eat = 0 eat 0 int ans = (R + L) * (R - L + 1) / 2 - eat; ans (R + L) * (R - L + 1) / 2 - eat (R + L) * (R - L + 1) / 2 (R + L) * (R - L + 1) (R + L) R L (R - L + 1) R - L R L 1 2 eat System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ

		Scanner sc = new Scanner(System.in);

		int N = sc.nextInt();
		int A = sc.nextInt();

		int L = A;
		int R = A + N - 1;

		int eat;
		if (R <= 0) {
			eat = R;
		} else if (L >= 0) {
			eat = L;
		} else {
			eat = 0;
		}
		int ans = (R + L) * (R - L + 1) / 2 - eat;
		System.out.println(ans);
    }
} public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ

		Scanner sc = new Scanner(System.in);

		int N = sc.nextInt();
		int A = sc.nextInt();

		int L = A;
		int R = A + N - 1;

		int eat;
		if (R <= 0) {
			eat = R;
		} else if (L >= 0) {
			eat = L;
		} else {
			eat = 0;
		}
		int ans = (R + L) * (R - L + 1) / 2 - eat;
		System.out.println(ans);
    }
} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ

		Scanner sc = new Scanner(System.in);

		int N = sc.nextInt();
		int A = sc.nextInt();

		int L = A;
		int R = A + N - 1;

		int eat;
		if (R <= 0) {
			eat = R;
		} else if (L >= 0) {
			eat = L;
		} else {
			eat = 0;
		}
		int ans = (R + L) * (R - L + 1) / 2 - eat;
		System.out.println(ans);
    }
}
  