#include <bits/stdc++.h>
#define ll long long



using namespace std;

void Xatab(){
    ll n, m, k;cin>>n>>m>>k;
    if(n % k == 0 and m % k == 0)cout<<(n/k)*(m/k);
    else if(n % k == 0 and m % k != 0)cout<<(n/k)*((m/k)+1);
    else if(n % k != 0 and m % k == 0)cout<<(1+(n/k))*(m/k);
    else cout<<(1+(n/k))*((m/k)+1);
}
int main()
{
    ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
    ll T = 1;//cin>>T;
    while(T--)Xatab();
    return 0;
}

