#include <bits/stdc++.h>
using namespace std;
const int maxn = 100005;
const int INF = 0x3f3f3f3f;
const int MOD = 998244353;
int i, j, n, v, now = 0, ans = 0, cnt = 0;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n >> v;
  now = n - 1;
  if (n <= v) cout << n - 1 << endl, exit(0);
  for (i = 1; i <= n; i++) {
    if (cnt >= 0 && now > 0) {
      ans += i * (v - cnt);
      now -= (v - cnt);
      cnt += v - cnt - 1;
    }
  }
  cout << ans << endl;
  return 0;
}
