#include <bits/stdc++.h>
using namespace std;
int main(){
	int n, m, k;
	cin>>n>>m>>k;
	int a = n/k, b = m/k, count=a*b, a_o = n%k, b_o=m%k;
	if((a_o==0) && (b_o==0)) cout<<count;
	else if(a_o == 0){
		count += n * b_o / k;
		cout<<count;
	}
	else if(b_o==0){
		count += m * a_o / k;
		cout<<count;
	}
	else{
		count += a + 1 + 1;
		cout<<count;
	}
	return 0;
}
