#include <bits/stdc++.h>
int main() {
  double m, n, a;
  double t, p;
  scanf("%lf %lf %lf", &m, &n, &a);
  t = m / a;
  p = n / a;
  if (a == 1) {
    printf("%.0lf\n", m * n);
  } else if (m * n <= a * a) {
    printf("1\n");
  } else if (ceil(t) > 1 || ceil(p) > 1) {
    printf("%.0lf\n", ceil(t) * ceil(p));
  } else {
    printf("%.0lf\n", ceil(t) + ceil(p));
  }
  return 0;
}
