#include <iostream>
using namespace std;


int main()
{
    int m, n, k;
    int sum;
    cin>>m>>n>>k;
    if(m % k != 0 or n % k != 0)
    {
        sum = ((m/k) * (n/k)) + k;
    }
    else if(m % k == 0 && n % k == 0)
    {
        sum = (m/k) * (n/k);
    }
    cout<<sum;
}
