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