#include <iostream>

using namespace std;
int main()
{
	long long n, m, k;
	cin >> n >> m >> k;

	long long a = (k + n - 1) / k;

	long long b = (k + m - 1) / k;

	long long c = a * b;
	cout << c << endl;
}

