import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		try (Scanner sc = new Scanner(System.in)) {
			int N, L;
			N = Integer.parseInt(sc.next());
			L = Integer.parseInt(sc.next());
			int[] aji = new int[N];

			int sum = 0;
			for (int i = 0; i < N; i++) {
				aji[i] = L + i;
				sum += aji[i];
			}
			
			int difMin = Integer.MAX_VALUE;
			int ans = 0;
			
			for (int i = 0; i < N; i++) {
				
				int dif = Math.abs(sum - (sum - aji[i]) );
				
				if (difMin > dif) {
					ans = sum - aji[i];
					difMin = dif;
				}
			}
			
			System.out.println(ans);
			
		} catch (Exception e) {
			// TODO: handle exception
		}
	}
	
} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		try (Scanner sc = new Scanner(System.in)) {
			int N, L;
			N = Integer.parseInt(sc.next());
			L = Integer.parseInt(sc.next());
			int[] aji = new int[N];

			int sum = 0;
			for (int i = 0; i < N; i++) {
				aji[i] = L + i;
				sum += aji[i];
			}
			
			int difMin = Integer.MAX_VALUE;
			int ans = 0;
			
			for (int i = 0; i < N; i++) {
				
				int dif = Math.abs(sum - (sum - aji[i]) );
				
				if (difMin > dif) {
					ans = sum - aji[i];
					difMin = dif;
				}
			}
			
			System.out.println(ans);
			
		} catch (Exception e) {
			// TODO: handle exception
		}
	}
	
} Main public static void main(String[] args) {
		// TODO Auto-generated method stub
		try (Scanner sc = new Scanner(System.in)) {
			int N, L;
			N = Integer.parseInt(sc.next());
			L = Integer.parseInt(sc.next());
			int[] aji = new int[N];

			int sum = 0;
			for (int i = 0; i < N; i++) {
				aji[i] = L + i;
				sum += aji[i];
			}
			
			int difMin = Integer.MAX_VALUE;
			int ans = 0;
			
			for (int i = 0; i < N; i++) {
				
				int dif = Math.abs(sum - (sum - aji[i]) );
				
				if (difMin > dif) {
					ans = sum - aji[i];
					difMin = dif;
				}
			}
			
			System.out.println(ans);
			
		} catch (Exception e) {
			// TODO: handle exception
		}
	} main {
		// TODO Auto-generated method stub
		try (Scanner sc = new Scanner(System.in)) {
			int N, L;
			N = Integer.parseInt(sc.next());
			L = Integer.parseInt(sc.next());
			int[] aji = new int[N];

			int sum = 0;
			for (int i = 0; i < N; i++) {
				aji[i] = L + i;
				sum += aji[i];
			}
			
			int difMin = Integer.MAX_VALUE;
			int ans = 0;
			
			for (int i = 0; i < N; i++) {
				
				int dif = Math.abs(sum - (sum - aji[i]) );
				
				if (difMin > dif) {
					ans = sum - aji[i];
					difMin = dif;
				}
			}
			
			System.out.println(ans);
			
		} catch (Exception e) {
			// TODO: handle exception
		}
	} try (Scanner sc = new Scanner(System.in)) {
			int N, L;
			N = Integer.parseInt(sc.next());
			L = Integer.parseInt(sc.next());
			int[] aji = new int[N];

			int sum = 0;
			for (int i = 0; i < N; i++) {
				aji[i] = L + i;
				sum += aji[i];
			}
			
			int difMin = Integer.MAX_VALUE;
			int ans = 0;
			
			for (int i = 0; i < N; i++) {
				
				int dif = Math.abs(sum - (sum - aji[i]) );
				
				if (difMin > dif) {
					ans = sum - aji[i];
					difMin = dif;
				}
			}
			
			System.out.println(ans);
			
		} catch (Exception e) {
			// TODO: handle exception
		} catch (Exception e) {
			// TODO: handle exception
		} Exception e {
			// TODO: handle exception
		} {
			int N, L;
			N = Integer.parseInt(sc.next());
			L = Integer.parseInt(sc.next());
			int[] aji = new int[N];

			int sum = 0;
			for (int i = 0; i < N; i++) {
				aji[i] = L + i;
				sum += aji[i];
			}
			
			int difMin = Integer.MAX_VALUE;
			int ans = 0;
			
			for (int i = 0; i < N; i++) {
				
				int dif = Math.abs(sum - (sum - aji[i]) );
				
				if (difMin > dif) {
					ans = sum - aji[i];
					difMin = dif;
				}
			}
			
			System.out.println(ans);
			
		} Scanner sc = new Scanner(System.in) Scanner sc = new Scanner(System.in) new Scanner(System.in) int N N L; L N = Integer.parseInt(sc.next()) N Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc L = Integer.parseInt(sc.next()) L Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int[] aji = new int[N]; aji new int[N] N int sum = 0; sum 0 for (int i = 0; i < N; i++) {
				aji[i] = L + i;
				sum += aji[i];
			} int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
				aji[i] = L + i;
				sum += aji[i];
			} {
				aji[i] = L + i;
				sum += aji[i];
			} aji[i] = L + i aji[i] aji i L + i L i sum += aji[i] sum aji[i] aji i int difMin = Integer.MAX_VALUE; difMin Integer.MAX_VALUE Integer Integer.MAX_VALUE int ans = 0; ans 0 for (int i = 0; i < N; i++) {
				
				int dif = Math.abs(sum - (sum - aji[i]) );
				
				if (difMin > dif) {
					ans = sum - aji[i];
					difMin = dif;
				}
			} int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
				
				int dif = Math.abs(sum - (sum - aji[i]) );
				
				if (difMin > dif) {
					ans = sum - aji[i];
					difMin = dif;
				}
			} {
				
				int dif = Math.abs(sum - (sum - aji[i]) );
				
				if (difMin > dif) {
					ans = sum - aji[i];
					difMin = dif;
				}
			} int dif = Math.abs(sum - (sum - aji[i]) ); dif Math.abs(sum - (sum - aji[i]) ) Math.abs Math sum - (sum - aji[i]) sum (sum - aji[i]) sum aji[i] aji i if (difMin > dif) {
					ans = sum - aji[i];
					difMin = dif;
				} difMin > dif difMin dif {
					ans = sum - aji[i];
					difMin = dif;
				} ans = sum - aji[i] ans sum - aji[i] sum aji[i] aji i difMin = dif difMin dif 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) {
		// TODO Auto-generated method stub
		try (Scanner sc = new Scanner(System.in)) {
			int N, L;
			N = Integer.parseInt(sc.next());
			L = Integer.parseInt(sc.next());
			int[] aji = new int[N];

			int sum = 0;
			for (int i = 0; i < N; i++) {
				aji[i] = L + i;
				sum += aji[i];
			}
			
			int difMin = Integer.MAX_VALUE;
			int ans = 0;
			
			for (int i = 0; i < N; i++) {
				
				int dif = Math.abs(sum - (sum - aji[i]) );
				
				if (difMin > dif) {
					ans = sum - aji[i];
					difMin = dif;
				}
			}
			
			System.out.println(ans);
			
		} catch (Exception e) {
			// TODO: handle exception
		}
	}
	
} public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		try (Scanner sc = new Scanner(System.in)) {
			int N, L;
			N = Integer.parseInt(sc.next());
			L = Integer.parseInt(sc.next());
			int[] aji = new int[N];

			int sum = 0;
			for (int i = 0; i < N; i++) {
				aji[i] = L + i;
				sum += aji[i];
			}
			
			int difMin = Integer.MAX_VALUE;
			int ans = 0;
			
			for (int i = 0; i < N; i++) {
				
				int dif = Math.abs(sum - (sum - aji[i]) );
				
				if (difMin > dif) {
					ans = sum - aji[i];
					difMin = dif;
				}
			}
			
			System.out.println(ans);
			
		} catch (Exception e) {
			// TODO: handle exception
		}
	}
	
} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		try (Scanner sc = new Scanner(System.in)) {
			int N, L;
			N = Integer.parseInt(sc.next());
			L = Integer.parseInt(sc.next());
			int[] aji = new int[N];

			int sum = 0;
			for (int i = 0; i < N; i++) {
				aji[i] = L + i;
				sum += aji[i];
			}
			
			int difMin = Integer.MAX_VALUE;
			int ans = 0;
			
			for (int i = 0; i < N; i++) {
				
				int dif = Math.abs(sum - (sum - aji[i]) );
				
				if (difMin > dif) {
					ans = sum - aji[i];
					difMin = dif;
				}
			}
			
			System.out.println(ans);
			
		} catch (Exception e) {
			// TODO: handle exception
		}
	}
	
}
