#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  long long n, m, s;
  cin >> n >> m >> s;
  long long ln, lm;
  if (n % s > 0) {
    ln = n - ((n / s) * s + (n % s > 0)) + 1;
  } else {
    ln = s;
  }
  if (m % s > 0) {
    lm = m - ((m / s) * s + (m % s > 0)) + 1;
  } else {
    lm = s;
  }
  cout << ln * lm * ((m + s - 1) / s) * ((n + s - 1) / s) << '\n';
  return 0;
}
