#include <bits/stdc++.h>
using namespace std;
long long K = 1;
int main() {
  long long n, m, s;
  cin >> n >> m >> s;
  n = ((n - 1) % s + 1) * ((n + s * (n % s != 0) - n % s) / s);
  m = ((m - 1) % s + 1) * ((m + s * (m % s != 0) - m % s) / s);
  cout << n * m;
  return 0;
}
