#include <bits/stdc++.h>
#define ll long long
#define pii pair<int,int>
#define F first
#define S second
#define pb push_back
using namespace std;
const int N = 2e5 + 5;
const int MN = 1e9 + 10;
long long int m,n,k,m1,n1;
int main(){
	ios_base::sync_with_stdio(0);
	cin.tie(0);cout.tie(0);
	cin>>n>>m>>k;
	if(m<=k&&n<=k){
		cout<<1;
		return 0;
	}
	if(m%k!=0){
		m1++;
	}
	if(n%k!=0){
		n1++;
	}
	m1+=m/k;
	n1+=n/k;
	cout<<n1*m1;
}