#include <bits/stdc++.h>
using namespace std;
void opt(long long n, long long spacing, long long* count, long long* optimal) {
  *optimal = 1 + (n - 1) / spacing;
  long long last = 1 + spacing * (*optimal - 1);
  *count = n - last + 1;
}
long long solve(long long n, long long m, long long s) {
  long long xc, xo, yc, yo;
  opt(n, s, &xc, &xo);
  opt(m, s, &yc, &yo);
  return xc * xo * yc * yo;
}
int main() {
  long long n, m, s;
  cin >> n >> m >> s;
  cout << solve(n, m, s) << endl;
  return 0;
}
