#include <bits/stdc++.h>
using namespace std;
double const EPS = 2.22045e-016;
int gcd(int a, int b) { return (b == 0 ? a : gcd(b, a % b)); }
int cntSame(int n, int s) { return (n / s) + ((n % s) != 0); }
int cntMx(int n, int s) {
  if (n % s == 0) return s;
  return n % s;
}
int main() {
  int n, m, s;
  cin >> n >> m >> s;
  long long r = cntSame(n, s), c = cntSame(m, s);
  long long nc = cntMx(n, s);
  long long nr = cntMx(m, s);
  cout << (nr * c * r * nc) << endl;
}
