#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 */
scalar_t__ containrem(int, int);
int /*<<< orphan*/ printf(char *, long long);
int /*<<< orphan*/ scanf(char *, int *, int *, int *);
int main() {
  int n, m, a, numn, numm;
  long long int tot;
  scanf("%d%d%d", &n, &m, &a);
  numn = n / a;
  if (containrem(n, a))
    numn += 1;
  numm = m / a;
  if (containrem(m, a))
    numm += 1;
  tot = (long long int)numm * numn;
  printf("%lld", tot);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
call   1050 <scanf@plt>
mov    -0x8(%rbp),%eax
cltd
idivl  -0x10(%rbp)
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1030 <containrem@plt>
cmp    $0x0,%rax
je     117f <main+0x4f>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
cltd
idivl  -0x10(%rbp)
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1030 <containrem@plt>
cmp    $0x0,%rax
je     11a7 <main+0x77>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
movslq -0x18(%rbp),%rax
movslq -0x14(%rbp),%rcx
imul   %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rsi
lea    0xe45(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
sub    $0x18,%rsp
lea    0xec3(%rip),%rdi
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
call   1050 <scanf@plt>
mov    0x14(%rsp),%edi
mov    0xc(%rsp),%esi
mov    %edi,%eax
cltd
idiv   %esi
mov    %eax,%ebx
call   1030 <containrem@plt>
cmp    $0x1,%rax
sbb    $0xffffffff,%ebx
mov    0x10(%rsp),%edi
mov    0xc(%rsp),%esi
mov    %edi,%eax
cltd
idiv   %esi
mov    %eax,%ebp
call   1030 <containrem@plt>
cmp    $0x1,%rax
sbb    $0xffffffff,%ebp
movslq %ebp,%rax
movslq %ebx,%rsi
imul   %rax,%rsi
lea    0xe6f(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %rbp
ret

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

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