#include <bits/stdc++.h>
int main() {
  long long int m, n, a, c = 0;
  scanf("%lld%lld%lld", &m, &n, &a);
  if (a != 1) {
    if (m % a == 0)
      c = (m / a);
    else
      c = (m / a) + 1;
    if (n % a == 0)
      c = c * (n / a);
    else
      c = c * ((n / a) + 1);
  } else {
    c = m * n;
  }
  printf("%lld", c);
  return 0;
}
