#include<stdio.h>

int M[4];

#define read(a) scanf("%d", &a)
#define write(a) printf("%d", a)
#define then
#define halt return 0

int main()
{
	step1: read(M[1]);
	step2: read(M[2]);
	step3: M[3] = 0;
	step4: M[2] = M[2] - 1;
	step5: M[3] = M[3] + M[1];
	step6: if (M[2] >= 0) then goto step4;
	step7: M[3] = M[3] - M[1];
	step8: write(M[3]);
	step9: halt;
}