import java.util.Scanner;

class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int taste = sc.nextInt();
        int max = 0;
        
        int[] arr = new int[N];
        
        for(int i = 0; i< N;i++) {
        	arr[i] = taste +i;
        	max += arr[i];
        }
        if(arr[0] > 0) {
        	System.out.println(max-arr[0]);
        }else if (arr[N-1] < 0) {
        	System.out.println(max-arr[N-1]);
        }else {
        	System.out.println(max);
        }
    }
} import java.util.Scanner; Scanner java.util class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int taste = sc.nextInt();
        int max = 0;
        
        int[] arr = new int[N];
        
        for(int i = 0; i< N;i++) {
        	arr[i] = taste +i;
        	max += arr[i];
        }
        if(arr[0] > 0) {
        	System.out.println(max-arr[0]);
        }else if (arr[N-1] < 0) {
        	System.out.println(max-arr[N-1]);
        }else {
        	System.out.println(max);
        }
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int taste = sc.nextInt();
        int max = 0;
        
        int[] arr = new int[N];
        
        for(int i = 0; i< N;i++) {
        	arr[i] = taste +i;
        	max += arr[i];
        }
        if(arr[0] > 0) {
        	System.out.println(max-arr[0]);
        }else if (arr[N-1] < 0) {
        	System.out.println(max-arr[N-1]);
        }else {
        	System.out.println(max);
        }
    } main {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int taste = sc.nextInt();
        int max = 0;
        
        int[] arr = new int[N];
        
        for(int i = 0; i< N;i++) {
        	arr[i] = taste +i;
        	max += arr[i];
        }
        if(arr[0] > 0) {
        	System.out.println(max-arr[0]);
        }else if (arr[N-1] < 0) {
        	System.out.println(max-arr[N-1]);
        }else {
        	System.out.println(max);
        }
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc int taste = sc.nextInt(); taste sc.nextInt() sc.nextInt sc int max = 0; max 0 int[] arr = new int[N]; arr new int[N] N for(int i = 0; i< N;i++) {
        	arr[i] = taste +i;
        	max += arr[i];
        } int i = 0; int i = 0; i 0 i< N i N i++ i++ i {
        	arr[i] = taste +i;
        	max += arr[i];
        } {
        	arr[i] = taste +i;
        	max += arr[i];
        } arr[i] = taste +i arr[i] arr i taste +i taste i max += arr[i] max arr[i] arr i if(arr[0] > 0) {
        	System.out.println(max-arr[0]);
        }else if (arr[N-1] < 0) {
        	System.out.println(max-arr[N-1]);
        }else {
        	System.out.println(max);
        } arr[0] > 0 arr[0] arr 0 0 {
        	System.out.println(max-arr[0]);
        } System.out.println(max-arr[0]) System.out.println System.out System System.out max-arr[0] max arr[0] arr 0 if (arr[N-1] < 0) {
        	System.out.println(max-arr[N-1]);
        }else {
        	System.out.println(max);
        } arr[N-1] < 0 arr[N-1] arr N-1 N 1 0 {
        	System.out.println(max-arr[N-1]);
        } System.out.println(max-arr[N-1]) System.out.println System.out System System.out max-arr[N-1] max arr[N-1] arr N-1 N 1 {
        	System.out.println(max);
        } System.out.println(max) System.out.println System.out System System.out max String[] args args
import java.util.Scanner;

class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int taste = sc.nextInt();
        int max = 0;
        
        int[] arr = new int[N];
        
        for(int i = 0; i< N;i++) {
        	arr[i] = taste +i;
        	max += arr[i];
        }
        if(arr[0] > 0) {
        	System.out.println(max-arr[0]);
        }else if (arr[N-1] < 0) {
        	System.out.println(max-arr[N-1]);
        }else {
        	System.out.println(max);
        }
    }
}