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