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