#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ printf(char *, long long);
int /*<<< orphan*/ scanf(char *, int *, int *, int *);
int main(int argc, char *argv[]) {
  int n, m, a;
  scanf("%d %d %d", &n, &m, &a);
  printf("%lld\n", (long long)(n / a + (n % a != 0 ? 1 : 0)) *
                       (m / a + (m % a != 0 ? 1 : 0)));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec3(%rip),%rdi
lea    -0x14(%rbp),%rsi
lea    -0x18(%rbp),%rdx
lea    -0x1c(%rbp),%rcx
call   1040 <scanf@plt>
mov    -0x14(%rbp),%eax
cltd
idivl  -0x1c(%rbp)
mov    %eax,-0x24(%rbp)
mov    -0x14(%rbp),%eax
cltd
idivl  -0x1c(%rbp)
mov    -0x24(%rbp),%eax
mov    %edx,%esi
xor    %ecx,%ecx
mov    $0x1,%edx
cmp    $0x0,%esi
cmovne %edx,%ecx
add    %ecx,%eax
movslq %eax,%rsi
mov    -0x18(%rbp),%eax
cltd
idivl  -0x1c(%rbp)
mov    %eax,-0x20(%rbp)
mov    -0x18(%rbp),%eax
cltd
idivl  -0x1c(%rbp)
mov    -0x20(%rbp),%eax
mov    %edx,%edi
xor    %ecx,%ecx
mov    $0x1,%edx
cmp    $0x0,%edi
cmovne %edx,%ecx
add    %ecx,%eax
cltq
imul   %rax,%rsi
lea    0xe61(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xed5(%rip),%rdi
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
call   1040 <scanf@plt>
mov    0x14(%rsp),%eax
mov    0xc(%rsp),%esi
cltd
idiv   %esi
mov    %eax,%ecx
cmp    $0x1,%edx
sbb    $0xffffffff,%ecx
mov    0x10(%rsp),%eax
cltd
idiv   %esi
movslq %ecx,%rcx
cmp    $0x1,%edx
sbb    $0xffffffff,%eax
movslq %eax,%rsi
imul   %rcx,%rsi
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [9 x i8] c"%d %d %d\00"
@.str.1 = [6 x i8] c"%lld\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32* %6, i32* %7, i32* %8)
%10 = load i32, i32* %6
%11 = load i32, i32* %8
%12 = sdiv i32 %10, %11
%13 = load i32, i32* %6
%14 = load i32, i32* %8
%15 = srem i32 %13, %14
%16 = icmp ne i32 %15, 0
%17 = zext i1 %16 to i64
%18 = select i1 %16, i32 1, i32 0
%19 = add nsw i32 %12, %18
%20 = sext i32 %19 to i64
%21 = load i32, i32* %7
%22 = load i32, i32* %8
%23 = sdiv i32 %21, %22
%24 = load i32, i32* %7
%25 = load i32, i32* %8
%26 = srem i32 %24, %25
%27 = icmp ne i32 %26, 0
%28 = zext i1 %27 to i64
%29 = select i1 %27, i32 1, i32 0
%30 = add nsw i32 %23, %29
%31 = sext i32 %30 to i64
%32 = mul nsw i64 %20, %31
%33 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i64 %32)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"%d %d %d\00"
@.str.1 = [6 x i8] c"%lld\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = bitcast i32* %3 to i8*
%7 = bitcast i32* %4 to i8*
%8 = bitcast i32* %5 to i8*
%9 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32* %3, i32* %4, i32* %5)
%10 = load i32, i32* %3
%11 = load i32, i32* %5
%12 = sdiv i32 %10, %11
%13 = srem i32 %10, %11
%14 = icmp ne i32 %13, 0
%15 = zext i1 %14 to i32
%16 = add nsw i32 %12, %15
%17 = sext i32 %16 to i64
%18 = load i32, i32* %4
%19 = sdiv i32 %18, %11
%20 = srem i32 %18, %11
%21 = icmp ne i32 %20, 0
%22 = zext i1 %21 to i32
%23 = add nsw i32 %19, %22
%24 = sext i32 %23 to i64
%25 = mul nsw i64 %24, %17
%26 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i64 %25)
ret i32 0
}