n,k = map(int,input().split()) ans = (n*(n+1))//2 #print(ans) sml = n sml -= k tmp = (sml*(sml+1))//2 hiku = ans-tmp sml = tmp-hiku #print(sml) print((ans-sml+2)//2)