#include <bits/stdc++.h>
using namespace std;
long long a, b, c, d, e, t1, t2, t3;
long long la, lb, lc;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n, m, s;
  cin >> n >> m >> s;
  a = 0;
  b = 0;
  long long i = 0;
  c = 1;
  if (s <= n) {
    while (i < n) {
      if (i + s < n) {
        i += s;
        ++c;
      } else {
        a = n - (i + 1);
        ++a;
        break;
      }
    }
  } else {
    c = n;
    a = 1;
  }
  i = 0;
  d = 1;
  if (s <= m) {
    while (i < m) {
      if (i + s < m) {
        i += s;
        ++d;
      } else {
        b = m - (i + 1);
        ++b;
        break;
      }
    }
  } else {
    d = m;
    b = 1;
  }
  e = c * d;
  t1 = a * b;
  cout << t1 * e;
  return 0;
}
