#include <bits/stdc++.h>
using namespace std;
#define accepted ios_base::sync_with_stdio(false);cin.tie(NULL);
#define Daulbekov signed    
#define Makan main
#define int long long
#define double long double

Daulbekov Makan(){
	accepted
	int n,m,k;
	cin>>n>>m>>k;
	int sum=max((n/k),1ll)*max((m/k),1ll);
	if (n%k!=0)
	{
		sum+=n/k;
	}
	if (m%k!=0)
	{
		sum+=m/k;
	}
	if (m%k!=0&&n%k!=0)
	{
		sum++;
	}
	if (k>=n&&k>=m)
	{
		cout<<1;
		return 0;
	}
	cout<<sum;
}