#include <iostream>
using namespace std;
int n, m, k, p, l;
int main()
{
  cin >> n >> m >> k;
  if(n % k != 0)
  p = n / k + 1;
  if(m % k != 0)
  l = m / k + 1;
   if(n % k == 0)
  p = n / k;
  if(m % k == 0)
  l = m / k;
  cout << p*l;
}