#include <bits/stdc++.h>
using namespace std;
int main() {
  long long x, y, z, n, m, a, b, c, d, e;
  cin >> n >> m >> x;
  if (n < m) swap(n, m);
  if (x >= n || x == 1) {
    cout << n * m << endl;
    return 0;
  }
  long long ans;
  ans = 0;
  a = (n - 1) / x + 1;
  b = (m - 1) / x + 1;
  z = b * a;
  d = (n - 1) / x + 1;
  for (a = 1; a < x + 1; a++) {
    if (a + (d - 1) * x > n) break;
  }
  a--;
  d = (m - 1) / x + 1;
  for (b = 1; b < x + 1; b++) {
    if (b + (d - 1) * x > m) break;
  }
  b--;
  ans = z * (a * b);
  cout << ans << endl;
  return 0;
}
