#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) && (k < n) && (k < m)){
		count += n * b_o / k;
		cout<<count;
	}
	else if((b_o==0) && (k < n) && (k < m)){
		count += m * a_o / k;
		cout<<count;
	}
	else if((a_o != 0) && (b_o != 0) && (k < n) && (k < m)){
		count += a + b + 1;
		cout<<count;
	}
	else if((m < k) || (n < k) && (k < n) && (k < m)){
		count += 1;
		cout<<count;
	}
	//else if((k > n) && (k > m)) cout<<1;
	else if((k > n) && (b_o == 0)) cout<<b;
	else if((k > n) && (b_o != 0)) cout<<b + 1;
	else if((k > m) && (a_o == 0)) cout<<a;
	else if((k > m) && (a_o != 0)) cout<<a + 1;
	return 0;
}
