#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, m, a, mcount = 0, ncount = 0, z;
  cin >> n >> m >> a;
  if (a < m || a < n) {
    long long int x = m / a;
    if (m % a != 0) {
      x = x + 1;
    }
    long long int y = n / a;
    if (n % a != 0) {
      y = y + 1;
    }
    z = x * y;
    cout << z << endl;
  } else {
    cout << "1" << endl;
  }
  return 0;
}
