#define _USE_MATH_DEFINES #include using namespace std; signed main() { ios::sync_with_stdio(false); cin.tie(0); long long n, k; cin >> n >> k; cout << k * (n + n - k + 1) / 2 + 1 << endl; return 0; }