output_description: Print the answer.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      N i
attempt: #!usr/bin/env python3
  from collections import defaultdict
  from collections import deque
  from heapq import heappush, heappop
  import sys
  import math
  import bisect
  import random
  import itertools
  
  sys.setrecursionlimit(10**5)
  stdin = sys.stdin
  
  
  def LI():
      return list(map(int, stdin.readline().split()))
  
  
  def LF():
      return list(map(float, stdin.readline().split()))
  
  
  def LI_():
      return list(map(lambda x: int(x) - 1, stdin.readline().split()))
  
  
  def II():
      return int(stdin.readline())
  
  
  def IF():
      return float(stdin.readline())
  
  
  def LS():
      return list(map(list, stdin.readline().split()))
  
  
  def S():
      return list(stdin.readline().rstrip())
  
  
  def IR(n):
      return [II() for _ in range(n)]
  
  
  def LIR(n):
      return [LI() for _ in range(n)]
  
  
  def FR(n):
      return [IF() for _ in range(n)]
  
  
  def LFR(n):
      return [LI() for _ in range(n)]
  
  
  def LIR_(n):
      return [LI_() for _ in range(n)]
  
  
  def SR(n):
      return [S() for _ in range(n)]
  
  
  def LSR(n):
      return [LS() for _ in range(n)]
  
  
  mod = 1000000007
  
  
  # A
  def A():
      n, i = LI()
      print(n - i + 1)
      return
  
  
  # B
  def B():
      x1, y1, x2, y2 = LI()
      a = x2 - x1
      b = y2 - y1
      print(x2 - b, y2 + a, x1 - b, y1 + a)
      return
  
  
  # C
  def C():
      n, k = LI()
      if k % 2:
          print((n // k) ** 3)
      else:
          print(int((n // k) ** 3 + ((n - k / 2) // k + 1) ** 3))
  
      return
  
  
  # D
  def D():
      return
  
  
  # E
  def E():
      return
  
  
  # F
  def F():
      return
  
  
  # G
  def G():
      return
  
  
  # H
  def H():
      return
  
  
  # Solve
  if __name__ == "__main__":
      C()
  
problem_description: Statement
  
  There is an N-car train.
  
  You are given an integer i. Find the value of j such that the following
  statement is true: "the i-th car from the front of the train is the j-th car
  from the back."
samples: [{"input": "4 2", "output": "3\n    \n\nThe second car from the front of a 4-car train is the third car from the back.\n\n* * *"}, {"input": "1 1", "output": "1\n    \n\n* * *"}, {"input": "15 11", "output": "5"}]