from operator import mul

from functools import reduce

def cmb(n,r):

    r = min(n-r,r)

    if r == 0: return 1

    over = reduce(mul, list(range(n, n - r, -1)))

    under = reduce(mul, list(range(1,r + 1)))

    return over // under

N,K=list(map(int,input().split()))

if K%2==0:

    print(((N//K)**3+(((N-K//2)//K+1)**3)))

else:

    print(((N//K)**3))
N,K=list(map(int,input().split()))

if K%2==0:

    print(((N//K)**3+(((N-K//2)//K+1)**3)))

else:

    print(((N//K)**3))
from operator import mul
from functools import reduce


def cmb(n, r):
    r = min(n - r, r)
    if r == 0:
        return 1
    over = reduce(mul, list(range(n, n - r, -1)))
    under = reduce(mul, list(range(1, r + 1)))
    return over // under


N, K = list(map(int, input().split()))
if K % 2 == 0:
    print(((N // K) ** 3 + (((N - K // 2) // K + 1) ** 3)))
else:
    print(((N // K) ** 3))

N, K = list(map(int, input().split()))
if K % 2 == 0:
    print(((N // K) ** 3 + (((N - K // 2) // K + 1) ** 3)))
else:
    print(((N // K) ** 3))

-from operator import mul -from functools import reduce - - -def cmb(n, r): -    r = min(n - r, r) -    if r == 0: -        return 1 -    over = reduce(mul, list(range(n, n - r, -1))) -    under = reduce(mul, list(range(1, r + 1))) -    return over // under - -