#include <bits/stdc++.h>
using namespace std;
#define int long long

signed main() {
  int n, k, ans;
  cin >> n >> k;

  int n0 = n / k;
  int n1 = (n + (k / 2)) / k;
  ans = n0 * n0 * n0;
  if (k % 2 == 0) ans += n1 * n1 * n1;
  cout << ans << endl;
}