#include <bits/stdc++.h>
using namespace std;
const long long int MOD = 1000000007;
int n, m, s;
int mx = 0, my = 0;
int cx = 0, cy = 0;
vector<int> x;
vector<int> y;
int main() {
  cin >> n >> m >> s;
  if (s == 1) {
    cout << (long long int)n * (long long int)m;
    return 0;
  }
  x.resize(n + 1);
  for (int i = 1; i <= n; ++i) {
    x[i] = (i - 1) / s;
    int l = n - i;
    x[i] += (l) / s;
  }
  y.resize(m + 1);
  for (int i = 1; i <= m; ++i) {
    y[i] = (i - 1) / s;
    int l = m - i;
    y[i] += (l) / s;
  }
  for (int i = 1; i <= n; ++i) {
    mx = max(x[i], mx);
  }
  for (int i = 1; i <= m; ++i) {
    my = max(y[i], my);
  }
  for (int i = 1; i <= n; ++i) {
    cx += (x[i] == mx);
  }
  for (int i = 1; i <= m; ++i) {
    cy += (y[i] == my);
  }
  cout << (long long int)cx * (long long int)cy;
  return 0;
}
