object Main extends App {
	val Array(n, k) = scala.io.StdIn.readLine.split(" ").map(_.toInt)

	val tp = 2*n/k
	var cnt = 0

	for(a <- 1 to tp; b <- 1 to tp; c <- 1 to tp){
		val t1 = a + b - c
		val t2 = a - b + c
		val t3 = -a + b + c

		if(t1 > 0 && t2 > 0 && t3 > 0){
			if(k%2 == 0 || (t1%2 == 0 && t2%2 == 0 && t3%2 == 0)){
				if(t1*k/2 <= n && t2*k/2 <= n && t3*k/2 <= n){
					cnt += 1
				}
			}
		}
	}

	println(cnt)
}