import java.util.*; import java.io.*; public class Main { public static void main(String[] args) throws Exception { new Main().run(); } void run() throws Exception { Scanner sc = new Scanner(System.in); long N = sc.nextLong(); long K = sc.nextLong(); long ans = 1; for (int i = 0; i < K; ++i) { ans += N - i; } System.out.println(ans); } void tr(Object... objects) { System.out.println(Arrays.deepToString(objects)); } }