#include <bits/stdc++.h>
using namespace std;
int main(void) {
  long long a, b, s;
  cin >> a >> b >> s;
  long long da = (a - 1) / s + 1, db = (b - 1) / s + 1;
  long long ca = (a - 1) % s + 1, cb = (b - 1) % s + 1;
  cout << ca * cb * da * db << endl;
  return 0;
}
