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[] data = new int[n+1];
    int total_apple = 0;
    int except_apple = 0;
    int apple = 0;
    int apple_i = 0;
    int answer = 0;
    int j = 1;

    for(int i = 1;i <= n;i++) {
      data[i] = l + i - 1;
      total_apple += data[i];
    }

    except_apple = total_apple - data[1];
    apple = Math.abs(total_apple - except_apple);

    for(int i = 1;i <= n;i++) {

      except_apple = total_apple - data[i];
      apple_i = Math.abs(total_apple - except_apple);

      if(apple > apple_i) {
        apple = apple_i;
        j = i;
      }

    }

    answer = total_apple - data[j];

    System.out.println(answer);

  }

} 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[] data = new int[n+1];
    int total_apple = 0;
    int except_apple = 0;
    int apple = 0;
    int apple_i = 0;
    int answer = 0;
    int j = 1;

    for(int i = 1;i <= n;i++) {
      data[i] = l + i - 1;
      total_apple += data[i];
    }

    except_apple = total_apple - data[1];
    apple = Math.abs(total_apple - except_apple);

    for(int i = 1;i <= n;i++) {

      except_apple = total_apple - data[i];
      apple_i = Math.abs(total_apple - except_apple);

      if(apple > apple_i) {
        apple = apple_i;
        j = i;
      }

    }

    answer = total_apple - data[j];

    System.out.println(answer);

  }

} Main public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int l = sc.nextInt();
    int[] data = new int[n+1];
    int total_apple = 0;
    int except_apple = 0;
    int apple = 0;
    int apple_i = 0;
    int answer = 0;
    int j = 1;

    for(int i = 1;i <= n;i++) {
      data[i] = l + i - 1;
      total_apple += data[i];
    }

    except_apple = total_apple - data[1];
    apple = Math.abs(total_apple - except_apple);

    for(int i = 1;i <= n;i++) {

      except_apple = total_apple - data[i];
      apple_i = Math.abs(total_apple - except_apple);

      if(apple > apple_i) {
        apple = apple_i;
        j = i;
      }

    }

    answer = total_apple - data[j];

    System.out.println(answer);

  } main {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int l = sc.nextInt();
    int[] data = new int[n+1];
    int total_apple = 0;
    int except_apple = 0;
    int apple = 0;
    int apple_i = 0;
    int answer = 0;
    int j = 1;

    for(int i = 1;i <= n;i++) {
      data[i] = l + i - 1;
      total_apple += data[i];
    }

    except_apple = total_apple - data[1];
    apple = Math.abs(total_apple - except_apple);

    for(int i = 1;i <= n;i++) {

      except_apple = total_apple - data[i];
      apple_i = Math.abs(total_apple - except_apple);

      if(apple > apple_i) {
        apple = apple_i;
        j = i;
      }

    }

    answer = total_apple - data[j];

    System.out.println(answer);

  } 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[] data = new int[n+1]; data new int[n+1] n+1 n 1 int total_apple = 0; total_apple 0 int except_apple = 0; except_apple 0 int apple = 0; apple 0 int apple_i = 0; apple_i 0 int answer = 0; answer 0 int j = 1; j 1 for(int i = 1;i <= n;i++) {
      data[i] = l + i - 1;
      total_apple += data[i];
    } int i = 1; int i = 1; i 1 i <= n i n i++ i++ i {
      data[i] = l + i - 1;
      total_apple += data[i];
    } {
      data[i] = l + i - 1;
      total_apple += data[i];
    } data[i] = l + i - 1 data[i] data i l + i - 1 l + i l i 1 total_apple += data[i] total_apple data[i] data i except_apple = total_apple - data[1] except_apple total_apple - data[1] total_apple data[1] data 1 apple = Math.abs(total_apple - except_apple) apple Math.abs(total_apple - except_apple) Math.abs Math total_apple - except_apple total_apple except_apple for(int i = 1;i <= n;i++) {

      except_apple = total_apple - data[i];
      apple_i = Math.abs(total_apple - except_apple);

      if(apple > apple_i) {
        apple = apple_i;
        j = i;
      }

    } int i = 1; int i = 1; i 1 i <= n i n i++ i++ i {

      except_apple = total_apple - data[i];
      apple_i = Math.abs(total_apple - except_apple);

      if(apple > apple_i) {
        apple = apple_i;
        j = i;
      }

    } {

      except_apple = total_apple - data[i];
      apple_i = Math.abs(total_apple - except_apple);

      if(apple > apple_i) {
        apple = apple_i;
        j = i;
      }

    } except_apple = total_apple - data[i] except_apple total_apple - data[i] total_apple data[i] data i apple_i = Math.abs(total_apple - except_apple) apple_i Math.abs(total_apple - except_apple) Math.abs Math total_apple - except_apple total_apple except_apple if(apple > apple_i) {
        apple = apple_i;
        j = i;
      } apple > apple_i apple apple_i {
        apple = apple_i;
        j = i;
      } apple = apple_i apple apple_i j = i j i answer = total_apple - data[j] answer total_apple - data[j] total_apple data[j] data j System.out.println(answer) System.out.println System.out System System.out answer 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[] data = new int[n+1];
    int total_apple = 0;
    int except_apple = 0;
    int apple = 0;
    int apple_i = 0;
    int answer = 0;
    int j = 1;

    for(int i = 1;i <= n;i++) {
      data[i] = l + i - 1;
      total_apple += data[i];
    }

    except_apple = total_apple - data[1];
    apple = Math.abs(total_apple - except_apple);

    for(int i = 1;i <= n;i++) {

      except_apple = total_apple - data[i];
      apple_i = Math.abs(total_apple - except_apple);

      if(apple > apple_i) {
        apple = apple_i;
        j = i;
      }

    }

    answer = total_apple - data[j];

    System.out.println(answer);

  }

} public class Main {

  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int l = sc.nextInt();
    int[] data = new int[n+1];
    int total_apple = 0;
    int except_apple = 0;
    int apple = 0;
    int apple_i = 0;
    int answer = 0;
    int j = 1;

    for(int i = 1;i <= n;i++) {
      data[i] = l + i - 1;
      total_apple += data[i];
    }

    except_apple = total_apple - data[1];
    apple = Math.abs(total_apple - except_apple);

    for(int i = 1;i <= n;i++) {

      except_apple = total_apple - data[i];
      apple_i = Math.abs(total_apple - except_apple);

      if(apple > apple_i) {
        apple = apple_i;
        j = i;
      }

    }

    answer = total_apple - data[j];

    System.out.println(answer);

  }

} 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[] data = new int[n+1];
    int total_apple = 0;
    int except_apple = 0;
    int apple = 0;
    int apple_i = 0;
    int answer = 0;
    int j = 1;

    for(int i = 1;i <= n;i++) {
      data[i] = l + i - 1;
      total_apple += data[i];
    }

    except_apple = total_apple - data[1];
    apple = Math.abs(total_apple - except_apple);

    for(int i = 1;i <= n;i++) {

      except_apple = total_apple - data[i];
      apple_i = Math.abs(total_apple - except_apple);

      if(apple > apple_i) {
        apple = apple_i;
        j = i;
      }

    }

    answer = total_apple - data[j];

    System.out.println(answer);

  }

}
