import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int N = scanner.nextInt();
		int L = scanner.nextInt();
		int pie = 0;
		
		if (L >= 0) {
			//System.out.println("1こめ");
			pie = (1 + N) * N / 2 + (L - 1) * N - L;
		} else if (L + N - 1 < 0) {
			//System.out.println("2こめ");
			pie = N * (N - 1) / 2 + (L - 1) * (N - 1);
		} else {
			//System.out.println("3こめ");
			pie = (1 + N) * N / 2 + (L - 1) * N;
		}
		System.out.println(pie);
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int N = scanner.nextInt();
		int L = scanner.nextInt();
		int pie = 0;
		
		if (L >= 0) {
			//System.out.println("1こめ");
			pie = (1 + N) * N / 2 + (L - 1) * N - L;
		} else if (L + N - 1 < 0) {
			//System.out.println("2こめ");
			pie = N * (N - 1) / 2 + (L - 1) * (N - 1);
		} else {
			//System.out.println("3こめ");
			pie = (1 + N) * N / 2 + (L - 1) * N;
		}
		System.out.println(pie);
	}
} Main public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int N = scanner.nextInt();
		int L = scanner.nextInt();
		int pie = 0;
		
		if (L >= 0) {
			//System.out.println("1こめ");
			pie = (1 + N) * N / 2 + (L - 1) * N - L;
		} else if (L + N - 1 < 0) {
			//System.out.println("2こめ");
			pie = N * (N - 1) / 2 + (L - 1) * (N - 1);
		} else {
			//System.out.println("3こめ");
			pie = (1 + N) * N / 2 + (L - 1) * N;
		}
		System.out.println(pie);
	} main {
		Scanner scanner = new Scanner(System.in);
		int N = scanner.nextInt();
		int L = scanner.nextInt();
		int pie = 0;
		
		if (L >= 0) {
			//System.out.println("1こめ");
			pie = (1 + N) * N / 2 + (L - 1) * N - L;
		} else if (L + N - 1 < 0) {
			//System.out.println("2こめ");
			pie = N * (N - 1) / 2 + (L - 1) * (N - 1);
		} else {
			//System.out.println("3こめ");
			pie = (1 + N) * N / 2 + (L - 1) * N;
		}
		System.out.println(pie);
	} Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int N = scanner.nextInt(); N scanner.nextInt() scanner.nextInt scanner int L = scanner.nextInt(); L scanner.nextInt() scanner.nextInt scanner int pie = 0; pie 0 if (L >= 0) {
			//System.out.println("1こめ");
			pie = (1 + N) * N / 2 + (L - 1) * N - L;
		} else if (L + N - 1 < 0) {
			//System.out.println("2こめ");
			pie = N * (N - 1) / 2 + (L - 1) * (N - 1);
		} else {
			//System.out.println("3こめ");
			pie = (1 + N) * N / 2 + (L - 1) * N;
		} L >= 0 L 0 {
			//System.out.println("1こめ");
			pie = (1 + N) * N / 2 + (L - 1) * N - L;
		} pie = (1 + N) * N / 2 + (L - 1) * N - L pie (1 + N) * N / 2 + (L - 1) * N - L (1 + N) * N / 2 + (L - 1) * N (1 + N) * N / 2 (1 + N) * N (1 + N) 1 N N 2 (L - 1) * N (L - 1) L 1 N L if (L + N - 1 < 0) {
			//System.out.println("2こめ");
			pie = N * (N - 1) / 2 + (L - 1) * (N - 1);
		} else {
			//System.out.println("3こめ");
			pie = (1 + N) * N / 2 + (L - 1) * N;
		} L + N - 1 < 0 L + N - 1 L + N L N 1 0 {
			//System.out.println("2こめ");
			pie = N * (N - 1) / 2 + (L - 1) * (N - 1);
		} pie = N * (N - 1) / 2 + (L - 1) * (N - 1) pie N * (N - 1) / 2 + (L - 1) * (N - 1) N * (N - 1) / 2 N * (N - 1) N (N - 1) N 1 2 (L - 1) * (N - 1) (L - 1) L 1 (N - 1) N 1 {
			//System.out.println("3こめ");
			pie = (1 + N) * N / 2 + (L - 1) * N;
		} pie = (1 + N) * N / 2 + (L - 1) * N pie (1 + N) * N / 2 + (L - 1) * N (1 + N) * N / 2 (1 + N) * N (1 + N) 1 N N 2 (L - 1) * N (L - 1) L 1 N System.out.println(pie) System.out.println System.out System System.out pie String[] args args public class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int N = scanner.nextInt();
		int L = scanner.nextInt();
		int pie = 0;
		
		if (L >= 0) {
			//System.out.println("1こめ");
			pie = (1 + N) * N / 2 + (L - 1) * N - L;
		} else if (L + N - 1 < 0) {
			//System.out.println("2こめ");
			pie = N * (N - 1) / 2 + (L - 1) * (N - 1);
		} else {
			//System.out.println("3こめ");
			pie = (1 + N) * N / 2 + (L - 1) * N;
		}
		System.out.println(pie);
	}
} public class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int N = scanner.nextInt();
		int L = scanner.nextInt();
		int pie = 0;
		
		if (L >= 0) {
			//System.out.println("1こめ");
			pie = (1 + N) * N / 2 + (L - 1) * N - L;
		} else if (L + N - 1 < 0) {
			//System.out.println("2こめ");
			pie = N * (N - 1) / 2 + (L - 1) * (N - 1);
		} else {
			//System.out.println("3こめ");
			pie = (1 + N) * N / 2 + (L - 1) * N;
		}
		System.out.println(pie);
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int N = scanner.nextInt();
		int L = scanner.nextInt();
		int pie = 0;
		
		if (L >= 0) {
			//System.out.println("1こめ");
			pie = (1 + N) * N / 2 + (L - 1) * N - L;
		} else if (L + N - 1 < 0) {
			//System.out.println("2こめ");
			pie = N * (N - 1) / 2 + (L - 1) * (N - 1);
		} else {
			//System.out.println("3こめ");
			pie = (1 + N) * N / 2 + (L - 1) * N;
		}
		System.out.println(pie);
	}
}
