#include <iostream>

using namespace std;

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