#include <bits/stdc++.h>
using namespace std;
int n, m, s;
int C1[3000000], C2[3000000];
map<int, long long> M1;
map<int, long long> M2;
int main() {
  cin >> n >> m >> s;
  for (int i = 0; i < n; i++) {
    int t = (n - i - 1);
    if (t < 0) t = 0;
    C1[i] = i / s + t / s;
  }
  for (int i = 0; i < m; i++) {
    int t = m - i - 1;
    if (t < 0) t = 0;
    C2[i] = i / s + t / s;
  }
  for (int i = 0; i < n; i++) {
    if (M1.find(-(C1[i] + 1)) != M1.end()) {
      pair<int, long long> t = *M1.find(-(C1[i] + 1));
      M1.erase(M1.find(-(C1[i] + 1)));
      M1.insert(make_pair(t.first, t.second + 1));
    } else
      M1.insert(make_pair(-(C1[i] + 1), 1));
  }
  for (int i = 0; i < m; i++) {
    if (M2.find(-(C2[i] + 1)) != M2.end()) {
      pair<int, long long> t = *M2.find(-(C2[i] + 1));
      M2.erase(M2.find(-(C2[i] + 1)));
      M2.insert(make_pair(t.first, t.second + 1));
    } else
      M2.insert(make_pair(-(C2[i] + 1), 1));
  }
  long long p1 = 0, p2 = 0;
  if (!M1.empty()) {
    pair<int, long long> t1 = *M1.begin();
    p1 = t1.second;
  }
  if (!M2.empty()) {
    pair<int, long long> t2 = *M2.begin();
    p2 = t2.second;
  }
  cout << p1 * p2 << endl;
  cin >> n;
  return 0;
}
