#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

int main(){
    int N,K ;
    cin >> N >> K ;
    long long  mod = 1000000007 ;
    int s = 0 ;
    int ans = 0 ;
    for(int idx = K;idx <= N+1 ;idx++){
        int min_val = idx * (2 * s + idx - 1) / 2;
        int max_val = idx * (2 * s + 2 * N - idx + 1) / 2 ;
        ans += (max_val - min_val + 1);
    }
    cout << ans << endl ;
    
}