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