#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, m, a, s = 0, p = 0;
  cin >> n >> m >> a;
  long long q = m / a + (m % a == 0 ? 0 : 1);
  p += n / a + (n % a == 0 ? 0 : 1);
  s += q * p;
  cout << s << endl;
  return 0;
}
