#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, m, s;
  cin >> n >> m >> s;
  long long dx = 0;
  long long dy = 0;
  long long i = 1;
  while (i <= n) {
    dx++;
    i += s;
  }
  long long kx = i - s;
  i = 1;
  while (i <= m) {
    dy++;
    i += s;
  }
  long long ky = i - s;
  long long ans = dx * dy;
  kx = n - kx;
  ky = m - ky;
  kx++;
  ky++;
  ans *= (kx * ky);
  cout << ans << endl;
  return 0;
}
