/******************************************************************************

                              Online C++ Compiler.
               Code, Compile, Run and Debug C++ program online.
Write your code in this editor and press "Run" button to compile and execute it.

*******************************************************************************/

#include <iostream>

using namespace std;

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

    return 0;
}
