#include <bits/stdc++.h>
using namespace std;

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    auto start = chrono::high_resolution_clock::now();

    long long n,m,k;
    cin>>n>>m>>k;
    long long ns=0,ms=0,ans=0;
    if(n%k!=0){
        ns+=n/k+1;
    }else{
        ns+=n/k;
    }
    if(m%k!=0){
        ms+=m/k+1;
    }else{
        ms+=m/k;
    }
    cout<<ms*ns;

    #ifdef Bilol
    auto duration = chrono::duration_cast<chrono::microseconds>(chrono::high_resolution_clock::now() - start);
    cout << endl << "time: " << (double)duration.count() / 1000.0 << " milliseconds" << endl;
    #endif
}