/*#pragma GCC optimize ("Ofast")
#pragma GCC optimize ("unroll-loops")
#pragma GCC target("avx,avx2,fma")*/
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
ll n,m,k,cnt;
void anomalous_solve()
{
	cin>>n>>m>>k;
	cnt+=(n/k)*(m/k);
	ll nn=n,mm=m;
	nn%=k;
	mm%=k;
	if(nn>0)
	{
		cnt+=(m-1)/k+1;
	}
	if(mm>0)
	{
		cnt+=(n-1)/k+1;
	}
	cout<<cnt;
}
int main()
{
	//	freopen("INPUT.txt","r",stdin);
	//  freopen("OUTPUT.txt","w",stdout);

	ios_base::sync_with_stdio();
    cin.tie(NULL);
    cout.tie(NULL);

    ll test=1;
	//cin>>test;
    for(int pos=1;pos<=test;pos++)
    	anomalous_solve();
}
