function Main(input){
	const args = input.split(" ");
  	const n = parseInt(args[0], 10);
  	const k = parseInt(args[1], 10);
	let count = 0;
	console.log(count);
  	if(k % 2 === 0){
		for(i = k; i <= n; i = i + k){
			count++
        }
	}else{
		for(i = k; i <= n; i = i + k){
			count++;
        }
		count = count*count*count;
    }
	console.log(count);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));