import java.io.InputStream;
import java.io.PrintStream;
import java.util.Scanner;

public class Main {
    static final int MAX = 100100100;
    InputStream in = System.in;
    PrintStream out = System.out;

    public void _main(String[] args) {
        Scanner sc = new Scanner(in);
        int N = sc.nextInt();
        int L = sc.nextInt();

        int sum=0;
        for(int i=1;i<=N;i++) sum+=L+i-1;
        int diff = MAX;
        int c=0;
        for(int i=1;i<=N;i++) {
            if (Math.abs((L+i-1))<diff) {
                c=sum-(L+i-1);
                diff = Math.abs((L+i-1));
            }
        }
        out.println(c);
    }

    public static void main(String[] args) {
        new Main()._main(args);
    }
} import java.io.InputStream; InputStream java.io import java.io.PrintStream; PrintStream java.io import java.util.Scanner; Scanner java.util public class Main {
    static final int MAX = 100100100;
    InputStream in = System.in;
    PrintStream out = System.out;

    public void _main(String[] args) {
        Scanner sc = new Scanner(in);
        int N = sc.nextInt();
        int L = sc.nextInt();

        int sum=0;
        for(int i=1;i<=N;i++) sum+=L+i-1;
        int diff = MAX;
        int c=0;
        for(int i=1;i<=N;i++) {
            if (Math.abs((L+i-1))<diff) {
                c=sum-(L+i-1);
                diff = Math.abs((L+i-1));
            }
        }
        out.println(c);
    }

    public static void main(String[] args) {
        new Main()._main(args);
    }
} Main static final int MAX = 100100100; MAX 100100100 InputStream in = System.in; in System.in System System.in PrintStream out = System.out; out System.out System System.out public void _main(String[] args) {
        Scanner sc = new Scanner(in);
        int N = sc.nextInt();
        int L = sc.nextInt();

        int sum=0;
        for(int i=1;i<=N;i++) sum+=L+i-1;
        int diff = MAX;
        int c=0;
        for(int i=1;i<=N;i++) {
            if (Math.abs((L+i-1))<diff) {
                c=sum-(L+i-1);
                diff = Math.abs((L+i-1));
            }
        }
        out.println(c);
    } _main {
        Scanner sc = new Scanner(in);
        int N = sc.nextInt();
        int L = sc.nextInt();

        int sum=0;
        for(int i=1;i<=N;i++) sum+=L+i-1;
        int diff = MAX;
        int c=0;
        for(int i=1;i<=N;i++) {
            if (Math.abs((L+i-1))<diff) {
                c=sum-(L+i-1);
                diff = Math.abs((L+i-1));
            }
        }
        out.println(c);
    } Scanner sc = new Scanner(in); sc new Scanner(in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc int L = sc.nextInt(); L sc.nextInt() sc.nextInt sc int sum=0; sum 0 for(int i=1;i<=N;i++) sum+=L+i-1; int i=1; int i=1; i 1 i<=N i N i++ i++ i sum+=L+i-1; sum+=L+i-1 sum L+i-1 L+i L i 1 int diff = MAX; diff MAX int c=0; c 0 for(int i=1;i<=N;i++) {
            if (Math.abs((L+i-1))<diff) {
                c=sum-(L+i-1);
                diff = Math.abs((L+i-1));
            }
        } int i=1; int i=1; i 1 i<=N i N i++ i++ i {
            if (Math.abs((L+i-1))<diff) {
                c=sum-(L+i-1);
                diff = Math.abs((L+i-1));
            }
        } {
            if (Math.abs((L+i-1))<diff) {
                c=sum-(L+i-1);
                diff = Math.abs((L+i-1));
            }
        } if (Math.abs((L+i-1))<diff) {
                c=sum-(L+i-1);
                diff = Math.abs((L+i-1));
            } Math.abs((L+i-1))<diff Math.abs((L+i-1)) Math.abs Math (L+i-1) L+i L i 1 diff {
                c=sum-(L+i-1);
                diff = Math.abs((L+i-1));
            } c=sum-(L+i-1) c sum-(L+i-1) sum (L+i-1) L+i L i 1 diff = Math.abs((L+i-1)) diff Math.abs((L+i-1)) Math.abs Math (L+i-1) L+i L i 1 out.println(c) out.println out c String[] args args public static void main(String[] args) {
        new Main()._main(args);
    } main {
        new Main()._main(args);
    } new Main()._main(args) new Main()._main new Main() args String[] args args public class Main {
    static final int MAX = 100100100;
    InputStream in = System.in;
    PrintStream out = System.out;

    public void _main(String[] args) {
        Scanner sc = new Scanner(in);
        int N = sc.nextInt();
        int L = sc.nextInt();

        int sum=0;
        for(int i=1;i<=N;i++) sum+=L+i-1;
        int diff = MAX;
        int c=0;
        for(int i=1;i<=N;i++) {
            if (Math.abs((L+i-1))<diff) {
                c=sum-(L+i-1);
                diff = Math.abs((L+i-1));
            }
        }
        out.println(c);
    }

    public static void main(String[] args) {
        new Main()._main(args);
    }
} public class Main {
    static final int MAX = 100100100;
    InputStream in = System.in;
    PrintStream out = System.out;

    public void _main(String[] args) {
        Scanner sc = new Scanner(in);
        int N = sc.nextInt();
        int L = sc.nextInt();

        int sum=0;
        for(int i=1;i<=N;i++) sum+=L+i-1;
        int diff = MAX;
        int c=0;
        for(int i=1;i<=N;i++) {
            if (Math.abs((L+i-1))<diff) {
                c=sum-(L+i-1);
                diff = Math.abs((L+i-1));
            }
        }
        out.println(c);
    }

    public static void main(String[] args) {
        new Main()._main(args);
    }
} Main
import java.io.InputStream;
import java.io.PrintStream;
import java.util.Scanner;

public class Main {
    static final int MAX = 100100100;
    InputStream in = System.in;
    PrintStream out = System.out;

    public void _main(String[] args) {
        Scanner sc = new Scanner(in);
        int N = sc.nextInt();
        int L = sc.nextInt();

        int sum=0;
        for(int i=1;i<=N;i++) sum+=L+i-1;
        int diff = MAX;
        int c=0;
        for(int i=1;i<=N;i++) {
            if (Math.abs((L+i-1))<diff) {
                c=sum-(L+i-1);
                diff = Math.abs((L+i-1));
            }
        }
        out.println(c);
    }

    public static void main(String[] args) {
        new Main()._main(args);
    }
}
