import java.util.Scanner;
public class Main{
 public static void main(String[] args){
   Scanner sc = new Scanner(System.in);
   int N = sc.nextInt();
   int L = sc.nextInt();
   int sum = 0;
   if(L <= 0 && 1-L<=N){
    for(int i = 0;i<N;i++){
     sum += i+L ;
    }
     System.out.println(sum);
   }else if(L > 0){
    for(int i = 1;i<N;i++){
     sum += i+L ;
    }
     System.out.println(sum);
   }else {
    for(int i = 0;i<N-1;i++){
     sum += i+L ;
    }
     System.out.println(sum);
   }
 
 }
} import java.util.Scanner; Scanner 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 sum = 0;
   if(L <= 0 && 1-L<=N){
    for(int i = 0;i<N;i++){
     sum += i+L ;
    }
     System.out.println(sum);
   }else if(L > 0){
    for(int i = 1;i<N;i++){
     sum += i+L ;
    }
     System.out.println(sum);
   }else {
    for(int i = 0;i<N-1;i++){
     sum += i+L ;
    }
     System.out.println(sum);
   }
 
 }
} Main public static void main(String[] args){
   Scanner sc = new Scanner(System.in);
   int N = sc.nextInt();
   int L = sc.nextInt();
   int sum = 0;
   if(L <= 0 && 1-L<=N){
    for(int i = 0;i<N;i++){
     sum += i+L ;
    }
     System.out.println(sum);
   }else if(L > 0){
    for(int i = 1;i<N;i++){
     sum += i+L ;
    }
     System.out.println(sum);
   }else {
    for(int i = 0;i<N-1;i++){
     sum += i+L ;
    }
     System.out.println(sum);
   }
 
 } main {
   Scanner sc = new Scanner(System.in);
   int N = sc.nextInt();
   int L = sc.nextInt();
   int sum = 0;
   if(L <= 0 && 1-L<=N){
    for(int i = 0;i<N;i++){
     sum += i+L ;
    }
     System.out.println(sum);
   }else if(L > 0){
    for(int i = 1;i<N;i++){
     sum += i+L ;
    }
     System.out.println(sum);
   }else {
    for(int i = 0;i<N-1;i++){
     sum += i+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 sum = 0; sum 0 if(L <= 0 && 1-L<=N){
    for(int i = 0;i<N;i++){
     sum += i+L ;
    }
     System.out.println(sum);
   }else if(L > 0){
    for(int i = 1;i<N;i++){
     sum += i+L ;
    }
     System.out.println(sum);
   }else {
    for(int i = 0;i<N-1;i++){
     sum += i+L ;
    }
     System.out.println(sum);
   } L <= 0 && 1-L<=N L <= 0 L 0 1-L<=N 1-L 1 L N {
    for(int i = 0;i<N;i++){
     sum += i+L ;
    }
     System.out.println(sum);
   } for(int i = 0;i<N;i++){
     sum += i+L ;
    } int i = 0; int i = 0; i 0 i<N i N i++ i++ i {
     sum += i+L ;
    } {
     sum += i+L ;
    } sum += i+L sum i+L i L System.out.println(sum) System.out.println System.out System System.out sum if(L > 0){
    for(int i = 1;i<N;i++){
     sum += i+L ;
    }
     System.out.println(sum);
   }else {
    for(int i = 0;i<N-1;i++){
     sum += i+L ;
    }
     System.out.println(sum);
   } L > 0 L 0 {
    for(int i = 1;i<N;i++){
     sum += i+L ;
    }
     System.out.println(sum);
   } for(int i = 1;i<N;i++){
     sum += i+L ;
    } int i = 1; int i = 1; i 1 i<N i N i++ i++ i {
     sum += i+L ;
    } {
     sum += i+L ;
    } sum += i+L sum i+L i L System.out.println(sum) System.out.println System.out System System.out sum {
    for(int i = 0;i<N-1;i++){
     sum += i+L ;
    }
     System.out.println(sum);
   } for(int i = 0;i<N-1;i++){
     sum += i+L ;
    } int i = 0; int i = 0; i 0 i<N-1 i N-1 N 1 i++ i++ i {
     sum += i+L ;
    } {
     sum += i+L ;
    } sum += i+L sum i+L i L System.out.println(sum) System.out.println System.out System System.out sum 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 sum = 0;
   if(L <= 0 && 1-L<=N){
    for(int i = 0;i<N;i++){
     sum += i+L ;
    }
     System.out.println(sum);
   }else if(L > 0){
    for(int i = 1;i<N;i++){
     sum += i+L ;
    }
     System.out.println(sum);
   }else {
    for(int i = 0;i<N-1;i++){
     sum += i+L ;
    }
     System.out.println(sum);
   }
 
 }
} public class Main{
 public static void main(String[] args){
   Scanner sc = new Scanner(System.in);
   int N = sc.nextInt();
   int L = sc.nextInt();
   int sum = 0;
   if(L <= 0 && 1-L<=N){
    for(int i = 0;i<N;i++){
     sum += i+L ;
    }
     System.out.println(sum);
   }else if(L > 0){
    for(int i = 1;i<N;i++){
     sum += i+L ;
    }
     System.out.println(sum);
   }else {
    for(int i = 0;i<N-1;i++){
     sum += i+L ;
    }
     System.out.println(sum);
   }
 
 }
} Main
import java.util.Scanner;
public class Main{
 public static void main(String[] args){
   Scanner sc = new Scanner(System.in);
   int N = sc.nextInt();
   int L = sc.nextInt();
   int sum = 0;
   if(L <= 0 && 1-L<=N){
    for(int i = 0;i<N;i++){
     sum += i+L ;
    }
     System.out.println(sum);
   }else if(L > 0){
    for(int i = 1;i<N;i++){
     sum += i+L ;
    }
     System.out.println(sum);
   }else {
    for(int i = 0;i<N-1;i++){
     sum += i+L ;
    }
     System.out.println(sum);
   }
 
 }
}