#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  long long int n, m, s;
  cin >> n >> m >> s;
  long long int a, b, c, d;
  a = n / s;
  b = n % s;
  c = m / s;
  d = m % s;
  if (b == 0) {
    b = s;
  } else {
    a++;
  }
  if (d == 0) {
    d = s;
  } else {
    c++;
  }
  cout << (a * b * c * d) << '\n';
}
