import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N =sc.nextInt();
		int L =sc.nextInt();
		int[] a = new int[N];
		int sum=0;
		int check=L;
		
		for(int i=0;i<N;i++) {
			a[i]=i+L;
			if(Math.abs(check)>Math.abs(a[i])) {
				check=Math.abs(a[i]);
				sum=i;
			}
		}
		a[sum]=0;
		sum=0;
		for(int i=0;i<N;i++) {
			sum+=a[i];
		}
		
		System.out.print(sum);
		
		sc.close();
	}
} import java.util.*; util.* java public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N =sc.nextInt();
		int L =sc.nextInt();
		int[] a = new int[N];
		int sum=0;
		int check=L;
		
		for(int i=0;i<N;i++) {
			a[i]=i+L;
			if(Math.abs(check)>Math.abs(a[i])) {
				check=Math.abs(a[i]);
				sum=i;
			}
		}
		a[sum]=0;
		sum=0;
		for(int i=0;i<N;i++) {
			sum+=a[i];
		}
		
		System.out.print(sum);
		
		sc.close();
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N =sc.nextInt();
		int L =sc.nextInt();
		int[] a = new int[N];
		int sum=0;
		int check=L;
		
		for(int i=0;i<N;i++) {
			a[i]=i+L;
			if(Math.abs(check)>Math.abs(a[i])) {
				check=Math.abs(a[i]);
				sum=i;
			}
		}
		a[sum]=0;
		sum=0;
		for(int i=0;i<N;i++) {
			sum+=a[i];
		}
		
		System.out.print(sum);
		
		sc.close();
	} main {
		Scanner sc = new Scanner(System.in);
		int N =sc.nextInt();
		int L =sc.nextInt();
		int[] a = new int[N];
		int sum=0;
		int check=L;
		
		for(int i=0;i<N;i++) {
			a[i]=i+L;
			if(Math.abs(check)>Math.abs(a[i])) {
				check=Math.abs(a[i]);
				sum=i;
			}
		}
		a[sum]=0;
		sum=0;
		for(int i=0;i<N;i++) {
			sum+=a[i];
		}
		
		System.out.print(sum);
		
		sc.close();
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N =sc.nextInt(); N sc.nextInt() sc.nextInt sc int L =sc.nextInt(); L sc.nextInt() sc.nextInt sc int[] a = new int[N]; a new int[N] N int sum=0; sum 0 int check=L; check L for(int i=0;i<N;i++) {
			a[i]=i+L;
			if(Math.abs(check)>Math.abs(a[i])) {
				check=Math.abs(a[i]);
				sum=i;
			}
		} int i=0; int i=0; i 0 i<N i N i++ i++ i {
			a[i]=i+L;
			if(Math.abs(check)>Math.abs(a[i])) {
				check=Math.abs(a[i]);
				sum=i;
			}
		} {
			a[i]=i+L;
			if(Math.abs(check)>Math.abs(a[i])) {
				check=Math.abs(a[i]);
				sum=i;
			}
		} a[i]=i+L a[i] a i i+L i L if(Math.abs(check)>Math.abs(a[i])) {
				check=Math.abs(a[i]);
				sum=i;
			} Math.abs(check)>Math.abs(a[i]) Math.abs(check) Math.abs Math check Math.abs(a[i]) Math.abs Math a[i] a i {
				check=Math.abs(a[i]);
				sum=i;
			} check=Math.abs(a[i]) check Math.abs(a[i]) Math.abs Math a[i] a i sum=i sum i a[sum]=0 a[sum] a sum 0 sum=0 sum 0 for(int i=0;i<N;i++) {
			sum+=a[i];
		} int i=0; int i=0; i 0 i<N i N i++ i++ i {
			sum+=a[i];
		} {
			sum+=a[i];
		} sum+=a[i] sum a[i] a i System.out.print(sum) System.out.print System.out System System.out sum sc.close() sc.close sc String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N =sc.nextInt();
		int L =sc.nextInt();
		int[] a = new int[N];
		int sum=0;
		int check=L;
		
		for(int i=0;i<N;i++) {
			a[i]=i+L;
			if(Math.abs(check)>Math.abs(a[i])) {
				check=Math.abs(a[i]);
				sum=i;
			}
		}
		a[sum]=0;
		sum=0;
		for(int i=0;i<N;i++) {
			sum+=a[i];
		}
		
		System.out.print(sum);
		
		sc.close();
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N =sc.nextInt();
		int L =sc.nextInt();
		int[] a = new int[N];
		int sum=0;
		int check=L;
		
		for(int i=0;i<N;i++) {
			a[i]=i+L;
			if(Math.abs(check)>Math.abs(a[i])) {
				check=Math.abs(a[i]);
				sum=i;
			}
		}
		a[sum]=0;
		sum=0;
		for(int i=0;i<N;i++) {
			sum+=a[i];
		}
		
		System.out.print(sum);
		
		sc.close();
	}
} Main
import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N =sc.nextInt();
		int L =sc.nextInt();
		int[] a = new int[N];
		int sum=0;
		int check=L;
		
		for(int i=0;i<N;i++) {
			a[i]=i+L;
			if(Math.abs(check)>Math.abs(a[i])) {
				check=Math.abs(a[i]);
				sum=i;
			}
		}
		a[sum]=0;
		sum=0;
		for(int i=0;i<N;i++) {
			sum+=a[i];
		}
		
		System.out.print(sum);
		
		sc.close();
	}
}
