import java.util.Scanner; public class Main { public static void main(String[] args) throws Exception { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int k = sc.nextInt(); sc.close(); long ans = 1; for (int i = 0; i < k; i++) { ans += n - i; } System.out.println(ans); } }