#include <iostream>

using namespace::std;

int main()
{
    long long int n, m, k;
    cin >> n >> m >> k;
    if(n%k!=0)
    {
        if(m%k!=0)
        {
            cout << (n/k+1)*(m/k+1) << endl;
        }
        else
        {
            cout << (n/k+1)*(m/k) << endl;
        }
    }
    else
        {
        if(m%k!=0)
        {
            cout << (n/k)*(m/k+1) << endl;
        }
        else
        {
            cout << (n/k)*(m/k) << endl;
        }
    }
    return 0;
}
