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