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

