#include<stdio.h>

int mod(int num, int need) {
	int patan = 0;
	int min = 0, max = 0;

	for (int i = 0; i < need; i++)
		min += i;

	for (int i = 1; i <= need; i++)
		max += num - i;

	return max - min + 1;
}

int main(void) {
	unsigned long int n, k, i, num = 0;

	scanf("%d%d", &n, &k);

	for (i = 0; i < (n + 1) - (k - 1); i++) {
		num += mod(n + 1, k + i);
	}

	printf("%d\n", num);

	return 0;
}