#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);
	if (n%k > 0) count+= m/k;
	if (m%k > 0) count+= n/k;
	cout << count;
}
