#include <cstdlib>
#include <iostream>

using namespace std;

int main()
{
    int m,n,k;
    cin >> m >> n >> k;
    while(m % k != 0)
        {
               m++;
        }
    while(n % k != 0)
        {
               n++;
        }
    cout << (m/k) * (n/k);
}
