// package app;

import java.math.BigDecimal;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
import java.util.Scanner;
import java.util.StringJoiner;
import java.util.stream.Stream;

public class Main {

    public static void main(final String[] args) throws Exception {

        Scanner sc = new Scanner(System.in);

        // long u = sc.nextLong();
        // long D = sc.nextLong();
        // long K = sc.nextLong();

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

        int excludeApple = 0;
        if (0 < L)
            excludeApple = 1;
        else
            excludeApple = Math.min(N, Math.abs(-1 + L));

        int sum = 0;
        for (int i = 1; i <= N; i++) {
            if (excludeApple == i)
                continue;

            sum += i - 1 + L;
        }

        System.out.println(sum);
    }
} import java.math.BigDecimal; BigDecimal java.math import java.util.Arrays; Arrays java.util import java.util.HashMap; HashMap java.util import java.util.Map; Map java.util import java.util.Objects; Objects java.util import java.util.Scanner; Scanner java.util import java.util.StringJoiner; StringJoiner java.util import java.util.stream.Stream; Stream java.util.stream public class Main {

    public static void main(final String[] args) throws Exception {

        Scanner sc = new Scanner(System.in);

        // long u = sc.nextLong();
        // long D = sc.nextLong();
        // long K = sc.nextLong();

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

        int excludeApple = 0;
        if (0 < L)
            excludeApple = 1;
        else
            excludeApple = Math.min(N, Math.abs(-1 + L));

        int sum = 0;
        for (int i = 1; i <= N; i++) {
            if (excludeApple == i)
                continue;

            sum += i - 1 + L;
        }

        System.out.println(sum);
    }
} Main public static void main(final String[] args) throws Exception {

        Scanner sc = new Scanner(System.in);

        // long u = sc.nextLong();
        // long D = sc.nextLong();
        // long K = sc.nextLong();

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

        int excludeApple = 0;
        if (0 < L)
            excludeApple = 1;
        else
            excludeApple = Math.min(N, Math.abs(-1 + L));

        int sum = 0;
        for (int i = 1; i <= N; i++) {
            if (excludeApple == i)
                continue;

            sum += i - 1 + L;
        }

        System.out.println(sum);
    } main {

        Scanner sc = new Scanner(System.in);

        // long u = sc.nextLong();
        // long D = sc.nextLong();
        // long K = sc.nextLong();

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

        int excludeApple = 0;
        if (0 < L)
            excludeApple = 1;
        else
            excludeApple = Math.min(N, Math.abs(-1 + L));

        int sum = 0;
        for (int i = 1; i <= N; i++) {
            if (excludeApple == i)
                continue;

            sum += i - 1 + L;
        }

        System.out.println(sum);
    } 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 excludeApple = 0; excludeApple 0 if (0 < L)
            excludeApple = 1;
        else
            excludeApple = Math.min(N, Math.abs(-1 + L)); 0 < L 0 L excludeApple = 1 excludeApple 1 excludeApple = Math.min(N, Math.abs(-1 + L)) excludeApple Math.min(N, Math.abs(-1 + L)) Math.min Math N Math.abs(-1 + L) Math.abs Math -1 + L -1 1 L int sum = 0; sum 0 for (int i = 1; i <= N; i++) {
            if (excludeApple == i)
                continue;

            sum += i - 1 + L;
        } int i = 1; int i = 1; i 1 i <= N i N i++ i++ i {
            if (excludeApple == i)
                continue;

            sum += i - 1 + L;
        } {
            if (excludeApple == i)
                continue;

            sum += i - 1 + L;
        } if (excludeApple == i)
                continue; excludeApple == i excludeApple i continue; sum += i - 1 + L sum i - 1 + L i - 1 i 1 L System.out.println(sum) System.out.println System.out System System.out sum final String[] args args public class Main {

    public static void main(final String[] args) throws Exception {

        Scanner sc = new Scanner(System.in);

        // long u = sc.nextLong();
        // long D = sc.nextLong();
        // long K = sc.nextLong();

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

        int excludeApple = 0;
        if (0 < L)
            excludeApple = 1;
        else
            excludeApple = Math.min(N, Math.abs(-1 + L));

        int sum = 0;
        for (int i = 1; i <= N; i++) {
            if (excludeApple == i)
                continue;

            sum += i - 1 + L;
        }

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

    public static void main(final String[] args) throws Exception {

        Scanner sc = new Scanner(System.in);

        // long u = sc.nextLong();
        // long D = sc.nextLong();
        // long K = sc.nextLong();

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

        int excludeApple = 0;
        if (0 < L)
            excludeApple = 1;
        else
            excludeApple = Math.min(N, Math.abs(-1 + L));

        int sum = 0;
        for (int i = 1; i <= N; i++) {
            if (excludeApple == i)
                continue;

            sum += i - 1 + L;
        }

        System.out.println(sum);
    }
} Main
// package app;

import java.math.BigDecimal;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
import java.util.Scanner;
import java.util.StringJoiner;
import java.util.stream.Stream;

public class Main {

    public static void main(final String[] args) throws Exception {

        Scanner sc = new Scanner(System.in);

        // long u = sc.nextLong();
        // long D = sc.nextLong();
        // long K = sc.nextLong();

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

        int excludeApple = 0;
        if (0 < L)
            excludeApple = 1;
        else
            excludeApple = Math.min(N, Math.abs(-1 + L));

        int sum = 0;
        for (int i = 1; i <= N; i++) {
            if (excludeApple == i)
                continue;

            sum += i - 1 + L;
        }

        System.out.println(sum);
    }
}