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[] d = new int[N];
        int min = 0;
        boolean first = true;
        boolean plus = true;
		for (int i = 1; i <= N; i++) {
			d[i-1] = L+i-1;
            int num = 0;
            boolean plus2 = true;
            if(d[i-1] < 0){
             num = 0 - d[i-1];
             plus2 = false;
            } else {
             num = d[i-1] - 0;
            }
          
            if(min > num || first){
              min = num;
              plus = plus2;
            }
            if(first){
              first = false;
            }
		}
        int ans = 0;
  		for (int i = 0; i < N; i++) {
           ans += d[i];
        }
        ans = plus ? ans - min : ans + min;
		System.out.println(ans);
	}		
} 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[] d = new int[N];
        int min = 0;
        boolean first = true;
        boolean plus = true;
		for (int i = 1; i <= N; i++) {
			d[i-1] = L+i-1;
            int num = 0;
            boolean plus2 = true;
            if(d[i-1] < 0){
             num = 0 - d[i-1];
             plus2 = false;
            } else {
             num = d[i-1] - 0;
            }
          
            if(min > num || first){
              min = num;
              plus = plus2;
            }
            if(first){
              first = false;
            }
		}
        int ans = 0;
  		for (int i = 0; i < N; i++) {
           ans += d[i];
        }
        ans = plus ? ans - min : ans + min;
		System.out.println(ans);
	}		
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		// 入力
		int N = sc.nextInt();
		int L = sc.nextInt();
		
		int[] d = new int[N];
        int min = 0;
        boolean first = true;
        boolean plus = true;
		for (int i = 1; i <= N; i++) {
			d[i-1] = L+i-1;
            int num = 0;
            boolean plus2 = true;
            if(d[i-1] < 0){
             num = 0 - d[i-1];
             plus2 = false;
            } else {
             num = d[i-1] - 0;
            }
          
            if(min > num || first){
              min = num;
              plus = plus2;
            }
            if(first){
              first = false;
            }
		}
        int ans = 0;
  		for (int i = 0; i < N; i++) {
           ans += d[i];
        }
        ans = plus ? ans - min : ans + min;
		System.out.println(ans);
	} main {
		Scanner sc = new Scanner(System.in);
		
		// 入力
		int N = sc.nextInt();
		int L = sc.nextInt();
		
		int[] d = new int[N];
        int min = 0;
        boolean first = true;
        boolean plus = true;
		for (int i = 1; i <= N; i++) {
			d[i-1] = L+i-1;
            int num = 0;
            boolean plus2 = true;
            if(d[i-1] < 0){
             num = 0 - d[i-1];
             plus2 = false;
            } else {
             num = d[i-1] - 0;
            }
          
            if(min > num || first){
              min = num;
              plus = plus2;
            }
            if(first){
              first = false;
            }
		}
        int ans = 0;
  		for (int i = 0; i < N; i++) {
           ans += d[i];
        }
        ans = plus ? ans - min : ans + min;
		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 L = sc.nextInt(); L sc.nextInt() sc.nextInt sc int[] d = new int[N]; d new int[N] N int min = 0; min 0 boolean first = true; first true boolean plus = true; plus true for (int i = 1; i <= N; i++) {
			d[i-1] = L+i-1;
            int num = 0;
            boolean plus2 = true;
            if(d[i-1] < 0){
             num = 0 - d[i-1];
             plus2 = false;
            } else {
             num = d[i-1] - 0;
            }
          
            if(min > num || first){
              min = num;
              plus = plus2;
            }
            if(first){
              first = false;
            }
		} int i = 1; int i = 1; i 1 i <= N i N i++ i++ i {
			d[i-1] = L+i-1;
            int num = 0;
            boolean plus2 = true;
            if(d[i-1] < 0){
             num = 0 - d[i-1];
             plus2 = false;
            } else {
             num = d[i-1] - 0;
            }
          
            if(min > num || first){
              min = num;
              plus = plus2;
            }
            if(first){
              first = false;
            }
		} {
			d[i-1] = L+i-1;
            int num = 0;
            boolean plus2 = true;
            if(d[i-1] < 0){
             num = 0 - d[i-1];
             plus2 = false;
            } else {
             num = d[i-1] - 0;
            }
          
            if(min > num || first){
              min = num;
              plus = plus2;
            }
            if(first){
              first = false;
            }
		} d[i-1] = L+i-1 d[i-1] d i-1 i 1 L+i-1 L+i L i 1 int num = 0; num 0 boolean plus2 = true; plus2 true if(d[i-1] < 0){
             num = 0 - d[i-1];
             plus2 = false;
            } else {
             num = d[i-1] - 0;
            } d[i-1] < 0 d[i-1] d i-1 i 1 0 {
             num = 0 - d[i-1];
             plus2 = false;
            } num = 0 - d[i-1] num 0 - d[i-1] 0 d[i-1] d i-1 i 1 plus2 = false plus2 false {
             num = d[i-1] - 0;
            } num = d[i-1] - 0 num d[i-1] - 0 d[i-1] d i-1 i 1 0 if(min > num || first){
              min = num;
              plus = plus2;
            } min > num || first min > num min num first {
              min = num;
              plus = plus2;
            } min = num min num plus = plus2 plus plus2 if(first){
              first = false;
            } first {
              first = false;
            } first = false first false int ans = 0; ans 0 for (int i = 0; i < N; i++) {
           ans += d[i];
        } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
           ans += d[i];
        } {
           ans += d[i];
        } ans += d[i] ans d[i] d i ans = plus ? ans - min : ans + min ans plus ? ans - min : ans + min plus ans - min ans min ans + min ans min 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) {
		Scanner sc = new Scanner(System.in);
		
		// 入力
		int N = sc.nextInt();
		int L = sc.nextInt();
		
		int[] d = new int[N];
        int min = 0;
        boolean first = true;
        boolean plus = true;
		for (int i = 1; i <= N; i++) {
			d[i-1] = L+i-1;
            int num = 0;
            boolean plus2 = true;
            if(d[i-1] < 0){
             num = 0 - d[i-1];
             plus2 = false;
            } else {
             num = d[i-1] - 0;
            }
          
            if(min > num || first){
              min = num;
              plus = plus2;
            }
            if(first){
              first = false;
            }
		}
        int ans = 0;
  		for (int i = 0; i < N; i++) {
           ans += d[i];
        }
        ans = plus ? ans - min : ans + min;
		System.out.println(ans);
	}		
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		// 入力
		int N = sc.nextInt();
		int L = sc.nextInt();
		
		int[] d = new int[N];
        int min = 0;
        boolean first = true;
        boolean plus = true;
		for (int i = 1; i <= N; i++) {
			d[i-1] = L+i-1;
            int num = 0;
            boolean plus2 = true;
            if(d[i-1] < 0){
             num = 0 - d[i-1];
             plus2 = false;
            } else {
             num = d[i-1] - 0;
            }
          
            if(min > num || first){
              min = num;
              plus = plus2;
            }
            if(first){
              first = false;
            }
		}
        int ans = 0;
  		for (int i = 0; i < N; i++) {
           ans += d[i];
        }
        ans = plus ? ans - min : ans + min;
		System.out.println(ans);
	}		
} 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[] d = new int[N];
        int min = 0;
        boolean first = true;
        boolean plus = true;
		for (int i = 1; i <= N; i++) {
			d[i-1] = L+i-1;
            int num = 0;
            boolean plus2 = true;
            if(d[i-1] < 0){
             num = 0 - d[i-1];
             plus2 = false;
            } else {
             num = d[i-1] - 0;
            }
          
            if(min > num || first){
              min = num;
              plus = plus2;
            }
            if(first){
              first = false;
            }
		}
        int ans = 0;
  		for (int i = 0; i < N; i++) {
           ans += d[i];
        }
        ans = plus ? ans - min : ans + min;
		System.out.println(ans);
	}		
}
