#include <bits/stdc++.h> 
using namespace std;
int main () {
	int n, m, k;
	cin >> n >> m >> k;
	
	if (n % k == 0 and m % k == 0) cout << (n * m) / (k * k);
	else cout << (n - (n % k)) * (m - (m % k)) / (k * k) + (((n % k) + (m % k))* k);
}
