#include <bits/stdc++.h>
using namespace std;
int main() {
  long long a, b, x, f1 = 0, f = 0;
  cin >> a >> b >> x;
  if ((x * x) >= (a * b)) {
    cout << 1;
    return 0;
  } else if (a == x) {
    cout << b;
    return 0;
  } else if (b == x) {
    cout << a;
    return 0;
  }
  if (a % x == 0)
    f = a / x;
  else
    f = a / x + 1;
  if (b % x == 0)
    f1 = b / x;
  else
    f1 = b / x + 1;
  cout << f * f1;
}
