#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int m = 0, n = 0, a = 0;
  while (cin >> m >> n >> a) {
    long long int mm = 0, nn = 0;
    if (m % a) {
      mm = m / a + 1;
    } else {
      mm = m / a;
    }
    if (n % a) {
      nn = n / a + 1;
    } else {
      nn = n / a;
    }
    cout << mm * nn << endl;
  }
  return 0;
}
