#include <iostream>
using namespace std;
int main (){
    long long n, m, k;
    cin >> n >> m >> k;
    if (n % k != 0){
        cout << (n / k + 1) * m / k;
    }else if(m % k != 0){
        cout << (m / k + 1) * n / k;
    }else if(n % k != 0 and m % k != 0){
        cout << (n / k + 1) * (m / k + 1);
    }else if (n % k == 0 and m % k == 0) {
    	cout << (n / k) * (m / k);
	}else {
		cout << 1;
	}
return 0;   
}
