#include <bits/stdc++.h>
using namespace std;

int main () {
	long long n, m, k;
	cin >> n >> m >> k;
	long long count = ((n < k && m < k)? 1: (n/k)*(m/k));
	if (n%k > 0) count += m/k; 
	if (m%k > 0) count += n/k;
	if (m%k > 0 && n%k > 0 && n > k && m > k) count++;  
	cout << count;
}
