#include <bits/stdc++.h>
using namespace std;
using ull = unsigned long long;
using ll = long long int;
ll binpow(ll a, ll b) {
  ll res = 1;
  while (b > 0) {
    if (b & 1) {
      res = res * a;
    }
    a = a * a;
    b >>= 1;
  }
  return res;
}
void solve() {
  ll m, n;
  cin >> m >> n;
  ll a;
  cin >> a;
  ll n1 = n % a;
  ll m1 = m % a;
  n = n / a;
  m = m / a;
  if ((n1 > 0) && (m1 > 0)) {
    cout << (m * n) + m + n + 1 << "\n";
  } else if (n1 > 0) {
    cout << (m * n) + m << "\n";
  } else if (m1 > 0) {
    cout << (m * n) + n << "\n";
  } else {
    cout << (m * n) << "\n";
  }
}
int main() {
  ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  solve();
}
