#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, m, s;
  cin >> n >> m >> s;
  long long tn = (n - 1) / s + 1;
  long long tm = (m - 1) / s + 1;
  long long sn = n - ((tn - 1) * s);
  long long sm = m - ((tm - 1) * s);
  long long res = tn * tm * sn * sm;
  cout << res << endl;
  return 0;
}
