import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); long n = sc.nextInt(); long k = sc.nextInt(); System.out.println((n * 2 - k + 1) * k / 2 + 1); } }