"use strict";

const main = arg => {
    const input = arg.trim().split("\n");

    const [N, K] = input[0].split(" ").map(parseInt);
    let ans = 0;
    const sum = function(i){
        return i(i+1)/2
    }
    for(let i = K; i<= n+1; i++){
        const min = sum(i)
        const max = sum(N) - sum(N-i)
        ans = ans + max-min+1
    }
    console.log(ans)
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));  

