#include <bits/stdc++.h>
using namespace std;
int n, m, s;
long long ans = 1;
void solve(int n) {
  int best = 0, sum = 0;
  int ok = -1;
  for (int i = 0; i < min(s, n); ++i) {
    int cnt = 0;
    for (int j = i; j < n; j += s) {
      ++cnt;
    }
    if (ok == -1) {
      ok = cnt;
    }
    if (ok == cnt) sum += ok;
  }
  ans *= sum;
}
int main() {
  cin >> n >> m >> s;
  solve(n);
  solve(m);
  cout << ans << endl;
  return 0;
}
