#include #define rep(i, a, n) for(int i = a; i < n; i++) #define int long long using namespace std; typedef pair P; const int mod = 1000000007; const int INF = 1e18; signed main(){ cin.tie(nullptr); ios::sync_with_stdio(false); int n, k; cin >> n >> k; cout << (k * (n - k + 1 + n)) / 2 + 1 << endl; }