#include<bits/stdc++.h>
#define ll long long
#define r0 return 0;
#define fr for(int i = 0;i < n;i++){cin>>a[i];}
#define YES cout<<"YES\n";
#define NO cout<<"NO\n";
using namespace std;
int main()
{
    ll n, m, k;
    cin>>n>>m>>k;
    ll a = n / k, b = m / k;
    if(n % k != 0 && m % k != 0)
    {
        cout<<a * b + a - 1 + b;
    }
    if(n % k != 0)
    {
        a++;
    }
    if(m % k != 0)
    {
        b++;
    }
    cout<<a * b;
}
