#include <bits/stdc++.h>
#define ll long long
using namespace std;
int main(){
	ll n,m,k;
	cin>>n>>m>>k;
	ll ans=(n/k)*(m/k);
	ll ans1=0;
	if(n%k!=0){
		ans1+=n/k;
	}
	if(m%k!=0){
		ans1+=m/k;
	}
	if(n%k!=0 && m%k!=0) ans1++;
	cout<<ans+ans1;
	}

