"use strict"
function main(arg) {
    var tmp = arg.trim().split("\n")[0].split(" ").map(Number)
    var N = tmp[0]
    var K = tmp[1]
    var counter = 0
    for (let i = K; i <= N + 1; i++) {
        var min = 0
        var max = 0
        for (var j = 0; j < i; j++) {
            min+=j
        }
        for (var j = N; j > N - i; j--) {
            max+=j
        }
        counter += (max-min) + 1
    }
    console.log(counter)
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));