#include<bits/stdc++.h>
#define ll long long
using namespace std;
void solve()
{
    ll a,b,c,ans=0,ans1=0;
    cin>>a>>b>>c;
    if (a % c != 0)
    {
        ans += a / c + 1;
    }
    else
    {
        ans += a / c;
    }
    if (b % c != 0)
    {
        ans1 += b / c + 1;
    }
    else
    {
        ans1 += b / c;
    }
    cout << ans1 * ans << endl;
}
int main ()
{
    ll T=1;
    //cin >> T;
    while(T --)
    {
      solve ();
    }
}
