#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, m, a, l, b;
  cin >> n >> m >> a;
  l = m / a;
  b = n / a;
  if (m % a != 0) l++;
  if (n % a != 0) b++;
  cout << l * b;
  return 0;
}
