import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        Main m = new Main(sc);
        m.show(m.solve());
        sc.close();
    }
    
	//フィールド
    Scanner sc;
    int N;
    int L;
    
    //入力
    Main(Scanner sc) {
        this.sc = sc;
        this.N = sc.nextInt();
        this.L = sc.nextInt();
    }
    
    //解答処理
    private int solve() {
    	int answer = 0;
    	int min = Integer.MAX_VALUE;
        
        int[] taste = new int[N];
        for (int i = 0; i < N; i++) {
        	taste[i] = L + (i+1) - 1;
        	answer += taste[i];
        	min = Math.min(Math.abs(taste[i]), min);
        }
        
        if (L + N - 1 < 0) {
        	answer += min;
        } else {
        	answer -= min;
        }
        return answer;
    }
    
    //出力
    public void show(int answer) {
        System.out.println(answer);
    }

} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        Main m = new Main(sc);
        m.show(m.solve());
        sc.close();
    }
    
	//フィールド
    Scanner sc;
    int N;
    int L;
    
    //入力
    Main(Scanner sc) {
        this.sc = sc;
        this.N = sc.nextInt();
        this.L = sc.nextInt();
    }
    
    //解答処理
    private int solve() {
    	int answer = 0;
    	int min = Integer.MAX_VALUE;
        
        int[] taste = new int[N];
        for (int i = 0; i < N; i++) {
        	taste[i] = L + (i+1) - 1;
        	answer += taste[i];
        	min = Math.min(Math.abs(taste[i]), min);
        }
        
        if (L + N - 1 < 0) {
        	answer += min;
        } else {
        	answer -= min;
        }
        return answer;
    }
    
    //出力
    public void show(int answer) {
        System.out.println(answer);
    }

} Main //フィールド
    Scanner sc; sc int N; N int L; L public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        Main m = new Main(sc);
        m.show(m.solve());
        sc.close();
    } main {
        Scanner sc = new Scanner(System.in);
        Main m = new Main(sc);
        m.show(m.solve());
        sc.close();
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) Main m = new Main(sc); m new Main(sc) m.show(m.solve()) m.show m m.solve() m.solve m sc.close() sc.close sc String[] args args //入力
    Main(Scanner sc) {
        this.sc = sc;
        this.N = sc.nextInt();
        this.L = sc.nextInt();
    } Main {
        this.sc = sc;
        this.N = sc.nextInt();
        this.L = sc.nextInt();
    } this.sc = sc this.sc this this.sc sc this.N = sc.nextInt() this.N this this.N sc.nextInt() sc.nextInt sc this.L = sc.nextInt() this.L this this.L sc.nextInt() sc.nextInt sc Scanner sc sc //解答処理
    private int solve() {
    	int answer = 0;
    	int min = Integer.MAX_VALUE;
        
        int[] taste = new int[N];
        for (int i = 0; i < N; i++) {
        	taste[i] = L + (i+1) - 1;
        	answer += taste[i];
        	min = Math.min(Math.abs(taste[i]), min);
        }
        
        if (L + N - 1 < 0) {
        	answer += min;
        } else {
        	answer -= min;
        }
        return answer;
    } solve {
    	int answer = 0;
    	int min = Integer.MAX_VALUE;
        
        int[] taste = new int[N];
        for (int i = 0; i < N; i++) {
        	taste[i] = L + (i+1) - 1;
        	answer += taste[i];
        	min = Math.min(Math.abs(taste[i]), min);
        }
        
        if (L + N - 1 < 0) {
        	answer += min;
        } else {
        	answer -= min;
        }
        return answer;
    } int answer = 0; answer 0 int min = Integer.MAX_VALUE; min Integer.MAX_VALUE Integer Integer.MAX_VALUE int[] taste = new int[N]; taste new int[N] N for (int i = 0; i < N; i++) {
        	taste[i] = L + (i+1) - 1;
        	answer += taste[i];
        	min = Math.min(Math.abs(taste[i]), min);
        } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
        	taste[i] = L + (i+1) - 1;
        	answer += taste[i];
        	min = Math.min(Math.abs(taste[i]), min);
        } {
        	taste[i] = L + (i+1) - 1;
        	answer += taste[i];
        	min = Math.min(Math.abs(taste[i]), min);
        } taste[i] = L + (i+1) - 1 taste[i] taste i L + (i+1) - 1 L + (i+1) L (i+1) i 1 1 answer += taste[i] answer taste[i] taste i min = Math.min(Math.abs(taste[i]), min) min Math.min(Math.abs(taste[i]), min) Math.min Math Math.abs(taste[i]) Math.abs Math taste[i] taste i min if (L + N - 1 < 0) {
        	answer += min;
        } else {
        	answer -= min;
        } L + N - 1 < 0 L + N - 1 L + N L N 1 0 {
        	answer += min;
        } answer += min answer min {
        	answer -= min;
        } answer -= min answer min return answer; answer //出力
    public void show(int answer) {
        System.out.println(answer);
    } show {
        System.out.println(answer);
    } System.out.println(answer) System.out.println System.out System System.out answer int answer answer public class Main {
	public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        Main m = new Main(sc);
        m.show(m.solve());
        sc.close();
    }
    
	//フィールド
    Scanner sc;
    int N;
    int L;
    
    //入力
    Main(Scanner sc) {
        this.sc = sc;
        this.N = sc.nextInt();
        this.L = sc.nextInt();
    }
    
    //解答処理
    private int solve() {
    	int answer = 0;
    	int min = Integer.MAX_VALUE;
        
        int[] taste = new int[N];
        for (int i = 0; i < N; i++) {
        	taste[i] = L + (i+1) - 1;
        	answer += taste[i];
        	min = Math.min(Math.abs(taste[i]), min);
        }
        
        if (L + N - 1 < 0) {
        	answer += min;
        } else {
        	answer -= min;
        }
        return answer;
    }
    
    //出力
    public void show(int answer) {
        System.out.println(answer);
    }

} public class Main {
	public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        Main m = new Main(sc);
        m.show(m.solve());
        sc.close();
    }
    
	//フィールド
    Scanner sc;
    int N;
    int L;
    
    //入力
    Main(Scanner sc) {
        this.sc = sc;
        this.N = sc.nextInt();
        this.L = sc.nextInt();
    }
    
    //解答処理
    private int solve() {
    	int answer = 0;
    	int min = Integer.MAX_VALUE;
        
        int[] taste = new int[N];
        for (int i = 0; i < N; i++) {
        	taste[i] = L + (i+1) - 1;
        	answer += taste[i];
        	min = Math.min(Math.abs(taste[i]), min);
        }
        
        if (L + N - 1 < 0) {
        	answer += min;
        } else {
        	answer -= min;
        }
        return answer;
    }
    
    //出力
    public void show(int answer) {
        System.out.println(answer);
    }

} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        Main m = new Main(sc);
        m.show(m.solve());
        sc.close();
    }
    
	//フィールド
    Scanner sc;
    int N;
    int L;
    
    //入力
    Main(Scanner sc) {
        this.sc = sc;
        this.N = sc.nextInt();
        this.L = sc.nextInt();
    }
    
    //解答処理
    private int solve() {
    	int answer = 0;
    	int min = Integer.MAX_VALUE;
        
        int[] taste = new int[N];
        for (int i = 0; i < N; i++) {
        	taste[i] = L + (i+1) - 1;
        	answer += taste[i];
        	min = Math.min(Math.abs(taste[i]), min);
        }
        
        if (L + N - 1 < 0) {
        	answer += min;
        } else {
        	answer -= min;
        }
        return answer;
    }
    
    //出力
    public void show(int answer) {
        System.out.println(answer);
    }

}
