#include <iostream>
#include <algorithm>
#include <cmath>
using namespace std;

int main() {
	long long k, m, n,s=0, l=0;
	cin >> n >> m >> k;
	if (n % k == 0) s += n / k;
	else if (n % k != 0) s += n / k+1;
	if (m % k == 0) l += m / k;
	else if (m % k != 0) l += m / k +1;
	cout << s * l;
}