#include <bits/stdc++.h>
using namespace std;
int n, d;
map<pair<int, int>, int> mp;
int main(void) {
  cin >> n >> d;
  int res = 0;
  for (int i = 1; i <= d; ++i) {
    res++;
    mp[make_pair(i - 1, i)] = mp[make_pair(i, i - 1)] = 1;
    for (int j = 0; j < i - 1; ++j) {
      mp[make_pair(j, i)] = mp[make_pair(i, j)] = i - j;
    }
  }
  for (int i = 0; i < n; ++i) {
    for (int j = i + 1; j < n; ++j) {
      if (mp[make_pair(i, j)] == 0) {
        res++;
        mp[make_pair(j, i)] = mp[make_pair(i, j)] = i - j;
      }
    }
  }
  cout << res << endl;
}
