#include <iostream>
#include <vector>
#include<string>
#include<set>
#include <stack>
#include <iomanip>
#include <cmath>
#include<map>
#include <deque>
#include <queue>
using namespace std;
using ll = long long;
using ld = long double;

ll gcd(ll a, ll b) {
	while (b > 0) {
		if (a < 0) {
			a = (a % b + b) % b;
		}
		else {
			a %= b;
		}
		swap(a, b);
	}
	return 0;
}
ll lcm(ll a, ll b) {
	return a / gcd(a, b) * b;
}
signed main(){
	ll m, n, k;
	cin >> m >> n >> k;
	cout << ll(((m+k-1)/k)*((n+k-1)/k));
	/*ll cnt
	vector <vector<char>> s(10, vector <char>(10));
	for (ll i = 0; i < 10; ++i) {
		for (ll j = 0; j < 10; ++j) {
			cin >> s[i][j];
		}
	}*/

}
