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