#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define pf push_front
const int N=1000000001;
int a[12][12];
/*int main()
{
    int n,m;
    cin>>n>>m;
    cnt=0;
    for(int i=0;i<n;i++){
        for(int j=0;j<m;j++){
            cin>>a[i][j];
            if(a[i][j]=='#') cnt++;
        }
    }
    if (cnt!=20){
        cout<<"NO"<<endl;
        return 0;
    }
    for(int i=0;i<n;i++){
        for(int j=0;j<m;j++){

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

    /*int h,w;
    cin>>h>>w;
    long long S;

    if (h%2 == 0)
    {
        S = (h+1) * (h/2) + h-1;
    }
    else
    {
        S = (h+1) * (h/2) + (h/2 + 1) + (h-1);
    }
    cout<<S * w + h*w;*/
}
