import java.io.*;
import java.util.*;

public class Main {
	

	public static void main(String[] args) throws IOException {
		Scanner sc = new Scanner();
		PrintWriter out = new PrintWriter(System.out);
		// (n-1) *L -(n-1) + 2+3+4+..+n
		int n=sc.nextInt(), L=sc.nextInt();
		int g0 = (n)*L-(n)+n*(n+1)/2;
		int g1 = (n - 1)*L-(n - 1)+n*(n+1)/2;
		int diff = g0 - g1;
		if(diff >= 0) {
			out.println(g1 - 1);
		} else {
			out.println(g1 + Math.max(-n, diff));
		}
		out.close();

	}

	static class Scanner {
		BufferedReader br;
		StringTokenizer st;

		Scanner() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}

		Scanner(String fileName) throws FileNotFoundException {
			br = new BufferedReader(new FileReader(fileName));
		}

		String next() throws IOException {
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}

		String nextLine() throws IOException {
			return br.readLine();
		}

		int nextInt() throws IOException {
			return Integer.parseInt(next());
		}

		long nextLong() throws NumberFormatException, IOException {
			return Long.parseLong(next());
		}

		double nextDouble() throws NumberFormatException, IOException {
			return Double.parseDouble(next());
		}

		boolean ready() throws IOException {
			return br.ready();
		}

	}

} import java.io.*; io.* java import java.util.*; util.* java public class Main {
	

	public static void main(String[] args) throws IOException {
		Scanner sc = new Scanner();
		PrintWriter out = new PrintWriter(System.out);
		// (n-1) *L -(n-1) + 2+3+4+..+n
		int n=sc.nextInt(), L=sc.nextInt();
		int g0 = (n)*L-(n)+n*(n+1)/2;
		int g1 = (n - 1)*L-(n - 1)+n*(n+1)/2;
		int diff = g0 - g1;
		if(diff >= 0) {
			out.println(g1 - 1);
		} else {
			out.println(g1 + Math.max(-n, diff));
		}
		out.close();

	}

	static class Scanner {
		BufferedReader br;
		StringTokenizer st;

		Scanner() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}

		Scanner(String fileName) throws FileNotFoundException {
			br = new BufferedReader(new FileReader(fileName));
		}

		String next() throws IOException {
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}

		String nextLine() throws IOException {
			return br.readLine();
		}

		int nextInt() throws IOException {
			return Integer.parseInt(next());
		}

		long nextLong() throws NumberFormatException, IOException {
			return Long.parseLong(next());
		}

		double nextDouble() throws NumberFormatException, IOException {
			return Double.parseDouble(next());
		}

		boolean ready() throws IOException {
			return br.ready();
		}

	}

} Main public static void main(String[] args) throws IOException {
		Scanner sc = new Scanner();
		PrintWriter out = new PrintWriter(System.out);
		// (n-1) *L -(n-1) + 2+3+4+..+n
		int n=sc.nextInt(), L=sc.nextInt();
		int g0 = (n)*L-(n)+n*(n+1)/2;
		int g1 = (n - 1)*L-(n - 1)+n*(n+1)/2;
		int diff = g0 - g1;
		if(diff >= 0) {
			out.println(g1 - 1);
		} else {
			out.println(g1 + Math.max(-n, diff));
		}
		out.close();

	} main {
		Scanner sc = new Scanner();
		PrintWriter out = new PrintWriter(System.out);
		// (n-1) *L -(n-1) + 2+3+4+..+n
		int n=sc.nextInt(), L=sc.nextInt();
		int g0 = (n)*L-(n)+n*(n+1)/2;
		int g1 = (n - 1)*L-(n - 1)+n*(n+1)/2;
		int diff = g0 - g1;
		if(diff >= 0) {
			out.println(g1 - 1);
		} else {
			out.println(g1 + Math.max(-n, diff));
		}
		out.close();

	} Scanner sc = new Scanner(); sc new Scanner() PrintWriter out = new PrintWriter(System.out); out new PrintWriter(System.out) int n=sc.nextInt() n sc.nextInt() sc.nextInt sc L=sc.nextInt(); L sc.nextInt() sc.nextInt sc int g0 = (n)*L-(n)+n*(n+1)/2; g0 (n)*L-(n)+n*(n+1)/2 (n)*L-(n) (n)*L (n) L (n) n*(n+1)/2 n*(n+1) n (n+1) n 1 2 int g1 = (n - 1)*L-(n - 1)+n*(n+1)/2; g1 (n - 1)*L-(n - 1)+n*(n+1)/2 (n - 1)*L-(n - 1) (n - 1)*L (n - 1) n 1 L (n - 1) n 1 n*(n+1)/2 n*(n+1) n (n+1) n 1 2 int diff = g0 - g1; diff g0 - g1 g0 g1 if(diff >= 0) {
			out.println(g1 - 1);
		} else {
			out.println(g1 + Math.max(-n, diff));
		} diff >= 0 diff 0 {
			out.println(g1 - 1);
		} out.println(g1 - 1) out.println out g1 - 1 g1 1 {
			out.println(g1 + Math.max(-n, diff));
		} out.println(g1 + Math.max(-n, diff)) out.println out g1 + Math.max(-n, diff) g1 Math.max(-n, diff) Math.max Math -n n diff out.close() out.close out String[] args args static class Scanner {
		BufferedReader br;
		StringTokenizer st;

		Scanner() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}

		Scanner(String fileName) throws FileNotFoundException {
			br = new BufferedReader(new FileReader(fileName));
		}

		String next() throws IOException {
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}

		String nextLine() throws IOException {
			return br.readLine();
		}

		int nextInt() throws IOException {
			return Integer.parseInt(next());
		}

		long nextLong() throws NumberFormatException, IOException {
			return Long.parseLong(next());
		}

		double nextDouble() throws NumberFormatException, IOException {
			return Double.parseDouble(next());
		}

		boolean ready() throws IOException {
			return br.ready();
		}

	} Scanner BufferedReader br; br StringTokenizer st; st Scanner() {
			br = new BufferedReader(new InputStreamReader(System.in));
		} Scanner {
			br = new BufferedReader(new InputStreamReader(System.in));
		} br = new BufferedReader(new InputStreamReader(System.in)) br new BufferedReader(new InputStreamReader(System.in)) Scanner(String fileName) throws FileNotFoundException {
			br = new BufferedReader(new FileReader(fileName));
		} Scanner {
			br = new BufferedReader(new FileReader(fileName));
		} br = new BufferedReader(new FileReader(fileName)) br new BufferedReader(new FileReader(fileName)) String fileName fileName String next() throws IOException {
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		} next {
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		} while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine()); st == null || !st.hasMoreTokens() st == null st null !st.hasMoreTokens() st.hasMoreTokens() st.hasMoreTokens st st = new StringTokenizer(br.readLine()) st new StringTokenizer(br.readLine()) return st.nextToken(); st.nextToken() st.nextToken st String nextLine() throws IOException {
			return br.readLine();
		} nextLine {
			return br.readLine();
		} return br.readLine(); br.readLine() br.readLine br int nextInt() throws IOException {
			return Integer.parseInt(next());
		} nextInt {
			return Integer.parseInt(next());
		} return Integer.parseInt(next()); Integer.parseInt(next()) Integer.parseInt Integer next() next long nextLong() throws NumberFormatException, IOException {
			return Long.parseLong(next());
		} nextLong {
			return Long.parseLong(next());
		} return Long.parseLong(next()); Long.parseLong(next()) Long.parseLong Long next() next double nextDouble() throws NumberFormatException, IOException {
			return Double.parseDouble(next());
		} nextDouble {
			return Double.parseDouble(next());
		} return Double.parseDouble(next()); Double.parseDouble(next()) Double.parseDouble Double next() next boolean ready() throws IOException {
			return br.ready();
		} ready {
			return br.ready();
		} return br.ready(); br.ready() br.ready br public class Main {
	

	public static void main(String[] args) throws IOException {
		Scanner sc = new Scanner();
		PrintWriter out = new PrintWriter(System.out);
		// (n-1) *L -(n-1) + 2+3+4+..+n
		int n=sc.nextInt(), L=sc.nextInt();
		int g0 = (n)*L-(n)+n*(n+1)/2;
		int g1 = (n - 1)*L-(n - 1)+n*(n+1)/2;
		int diff = g0 - g1;
		if(diff >= 0) {
			out.println(g1 - 1);
		} else {
			out.println(g1 + Math.max(-n, diff));
		}
		out.close();

	}

	static class Scanner {
		BufferedReader br;
		StringTokenizer st;

		Scanner() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}

		Scanner(String fileName) throws FileNotFoundException {
			br = new BufferedReader(new FileReader(fileName));
		}

		String next() throws IOException {
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}

		String nextLine() throws IOException {
			return br.readLine();
		}

		int nextInt() throws IOException {
			return Integer.parseInt(next());
		}

		long nextLong() throws NumberFormatException, IOException {
			return Long.parseLong(next());
		}

		double nextDouble() throws NumberFormatException, IOException {
			return Double.parseDouble(next());
		}

		boolean ready() throws IOException {
			return br.ready();
		}

	}

} public class Main {
	

	public static void main(String[] args) throws IOException {
		Scanner sc = new Scanner();
		PrintWriter out = new PrintWriter(System.out);
		// (n-1) *L -(n-1) + 2+3+4+..+n
		int n=sc.nextInt(), L=sc.nextInt();
		int g0 = (n)*L-(n)+n*(n+1)/2;
		int g1 = (n - 1)*L-(n - 1)+n*(n+1)/2;
		int diff = g0 - g1;
		if(diff >= 0) {
			out.println(g1 - 1);
		} else {
			out.println(g1 + Math.max(-n, diff));
		}
		out.close();

	}

	static class Scanner {
		BufferedReader br;
		StringTokenizer st;

		Scanner() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}

		Scanner(String fileName) throws FileNotFoundException {
			br = new BufferedReader(new FileReader(fileName));
		}

		String next() throws IOException {
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}

		String nextLine() throws IOException {
			return br.readLine();
		}

		int nextInt() throws IOException {
			return Integer.parseInt(next());
		}

		long nextLong() throws NumberFormatException, IOException {
			return Long.parseLong(next());
		}

		double nextDouble() throws NumberFormatException, IOException {
			return Double.parseDouble(next());
		}

		boolean ready() throws IOException {
			return br.ready();
		}

	}

} Main
import java.io.*;
import java.util.*;

public class Main {
	

	public static void main(String[] args) throws IOException {
		Scanner sc = new Scanner();
		PrintWriter out = new PrintWriter(System.out);
		// (n-1) *L -(n-1) + 2+3+4+..+n
		int n=sc.nextInt(), L=sc.nextInt();
		int g0 = (n)*L-(n)+n*(n+1)/2;
		int g1 = (n - 1)*L-(n - 1)+n*(n+1)/2;
		int diff = g0 - g1;
		if(diff >= 0) {
			out.println(g1 - 1);
		} else {
			out.println(g1 + Math.max(-n, diff));
		}
		out.close();

	}

	static class Scanner {
		BufferedReader br;
		StringTokenizer st;

		Scanner() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}

		Scanner(String fileName) throws FileNotFoundException {
			br = new BufferedReader(new FileReader(fileName));
		}

		String next() throws IOException {
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}

		String nextLine() throws IOException {
			return br.readLine();
		}

		int nextInt() throws IOException {
			return Integer.parseInt(next());
		}

		long nextLong() throws NumberFormatException, IOException {
			return Long.parseLong(next());
		}

		double nextDouble() throws NumberFormatException, IOException {
			return Double.parseDouble(next());
		}

		boolean ready() throws IOException {
			return br.ready();
		}

	}

}