import java.util.Scanner;
import java.util.stream.IntStream;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        final int N = sc.nextInt();
        final int L = sc.nextInt();

        final int[] tastes = new int[N];
        for (int i = 0; i < N; i++) {
            tastes[i] = L + (i+1) - 1;
        }

        int x = -1;
        int min = Integer.MAX_VALUE;
        for (int i = 0; i < N; i++) {
            if (min > Math.abs(tastes[i])) {
                x = i;
                min = Math.abs(tastes[i]);
            }
        }

        tastes[x] = 0;

        System.out.println(IntStream.of(tastes).sum());
    }
} import java.util.Scanner; Scanner java.util import java.util.stream.IntStream; IntStream java.util.stream public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        final int N = sc.nextInt();
        final int L = sc.nextInt();

        final int[] tastes = new int[N];
        for (int i = 0; i < N; i++) {
            tastes[i] = L + (i+1) - 1;
        }

        int x = -1;
        int min = Integer.MAX_VALUE;
        for (int i = 0; i < N; i++) {
            if (min > Math.abs(tastes[i])) {
                x = i;
                min = Math.abs(tastes[i]);
            }
        }

        tastes[x] = 0;

        System.out.println(IntStream.of(tastes).sum());
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        final int N = sc.nextInt();
        final int L = sc.nextInt();

        final int[] tastes = new int[N];
        for (int i = 0; i < N; i++) {
            tastes[i] = L + (i+1) - 1;
        }

        int x = -1;
        int min = Integer.MAX_VALUE;
        for (int i = 0; i < N; i++) {
            if (min > Math.abs(tastes[i])) {
                x = i;
                min = Math.abs(tastes[i]);
            }
        }

        tastes[x] = 0;

        System.out.println(IntStream.of(tastes).sum());
    } main {
        Scanner sc = new Scanner(System.in);

        final int N = sc.nextInt();
        final int L = sc.nextInt();

        final int[] tastes = new int[N];
        for (int i = 0; i < N; i++) {
            tastes[i] = L + (i+1) - 1;
        }

        int x = -1;
        int min = Integer.MAX_VALUE;
        for (int i = 0; i < N; i++) {
            if (min > Math.abs(tastes[i])) {
                x = i;
                min = Math.abs(tastes[i]);
            }
        }

        tastes[x] = 0;

        System.out.println(IntStream.of(tastes).sum());
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) final int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc final int L = sc.nextInt(); L sc.nextInt() sc.nextInt sc final int[] tastes = new int[N]; tastes new int[N] N for (int i = 0; i < N; i++) {
            tastes[i] = L + (i+1) - 1;
        } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
            tastes[i] = L + (i+1) - 1;
        } {
            tastes[i] = L + (i+1) - 1;
        } tastes[i] = L + (i+1) - 1 tastes[i] tastes i L + (i+1) - 1 L + (i+1) L (i+1) i 1 1 int x = -1; x -1 1 int min = Integer.MAX_VALUE; min Integer.MAX_VALUE Integer Integer.MAX_VALUE for (int i = 0; i < N; i++) {
            if (min > Math.abs(tastes[i])) {
                x = i;
                min = Math.abs(tastes[i]);
            }
        } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
            if (min > Math.abs(tastes[i])) {
                x = i;
                min = Math.abs(tastes[i]);
            }
        } {
            if (min > Math.abs(tastes[i])) {
                x = i;
                min = Math.abs(tastes[i]);
            }
        } if (min > Math.abs(tastes[i])) {
                x = i;
                min = Math.abs(tastes[i]);
            } min > Math.abs(tastes[i]) min Math.abs(tastes[i]) Math.abs Math tastes[i] tastes i {
                x = i;
                min = Math.abs(tastes[i]);
            } x = i x i min = Math.abs(tastes[i]) min Math.abs(tastes[i]) Math.abs Math tastes[i] tastes i tastes[x] = 0 tastes[x] tastes x 0 System.out.println(IntStream.of(tastes).sum()) System.out.println System.out System System.out IntStream.of(tastes).sum() IntStream.of(tastes).sum IntStream.of(tastes) IntStream.of IntStream tastes String[] args args public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        final int N = sc.nextInt();
        final int L = sc.nextInt();

        final int[] tastes = new int[N];
        for (int i = 0; i < N; i++) {
            tastes[i] = L + (i+1) - 1;
        }

        int x = -1;
        int min = Integer.MAX_VALUE;
        for (int i = 0; i < N; i++) {
            if (min > Math.abs(tastes[i])) {
                x = i;
                min = Math.abs(tastes[i]);
            }
        }

        tastes[x] = 0;

        System.out.println(IntStream.of(tastes).sum());
    }
} public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        final int N = sc.nextInt();
        final int L = sc.nextInt();

        final int[] tastes = new int[N];
        for (int i = 0; i < N; i++) {
            tastes[i] = L + (i+1) - 1;
        }

        int x = -1;
        int min = Integer.MAX_VALUE;
        for (int i = 0; i < N; i++) {
            if (min > Math.abs(tastes[i])) {
                x = i;
                min = Math.abs(tastes[i]);
            }
        }

        tastes[x] = 0;

        System.out.println(IntStream.of(tastes).sum());
    }
} Main
import java.util.Scanner;
import java.util.stream.IntStream;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        final int N = sc.nextInt();
        final int L = sc.nextInt();

        final int[] tastes = new int[N];
        for (int i = 0; i < N; i++) {
            tastes[i] = L + (i+1) - 1;
        }

        int x = -1;
        int min = Integer.MAX_VALUE;
        for (int i = 0; i < N; i++) {
            if (min > Math.abs(tastes[i])) {
                x = i;
                min = Math.abs(tastes[i]);
            }
        }

        tastes[x] = 0;

        System.out.println(IntStream.of(tastes).sum());
    }
}
