#include <iostream>
#include <vector>
#include <tuple>
#include <fstream>
#include <stdio.h>
#include <algorithm>
#include <string>
#include <cmath>
#include <queue>
#define REP(i, n) for(int i = 0; i < n; i++)
using ll = long long;
using namespace std;


int main() {

  cin.tie(0);
  ios::sync_with_stdio(false);

  ll n,k,ans=0, tmp;
  cin >> n >> k;

  for(ll i = k; i < n+2; i++){
    tmp = i * (n-i + 1) + 1;
    ans += tmp;
  }
  
  cout << ans << endl;
      
}
