#include <algorithm>
#include <iostream>
#include <cstdint>

int main() {
  int N, K;
  std::cin >> N >> K;
  std::int64_t sum = 0;
  for (int ab = 2; ab <= 2 * N; ++ab) {
    const int cd = ab - K;
    if (cd < 2 || cd > 2 * N) continue;
    sum += std::min<std::int64_t>(ab - 1, 2 * N - ab + 1) * std::min<std::int64_t>(cd - 1, 2 * N - cd + 1);
  }
  std::cout << sum << std::endl;
  return 0;
}

#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG
#define rep(i, n) for (int64_t i = 0; i < (int64_t)(n); i++)
using vi = vector<int64_t>;
using vvi = vector<vi>;
using ll = int64_t;
using P = pair<ll,ll>;
ll INF = 1000000007;
// ll INF = 9223372036854775807;
// ll INF = 998244353;

int main() {
    // fasten cin
    cin.tie(0);
    ios::sync_with_stdio(false);
    // implement
    ll n,w;
    cin >> n >> w;
    cout << n/w << endl;
}
