#include <bits/stdc++.h>
using namespace std;
int main() {
  unsigned long long n, m, d;
  unsigned long long tmp, max = 0, npoints = 0, ans = 0;
  cin >> n >> m >> d;
  npoints = (((n - 1) / d) + 1) * (((m - 1) / d) + 1) * ((n - 1) % d + 1) *
            ((m - 1) % d + 1);
  cout << npoints << endl;
}
