#include <bits/stdc++.h>
using namespace std;
/*
<<<<It's never too late for a new beginning in your life>>>>
Today is hard
  tomorrow will worse
  but the day after tomorrow will be the sunshine..

HARD WORK BEATS TALENT WHEN TALENT DOESN'T WORK HARD............
Never give up  */

//The most CHALISHKANCHIK
#define ios ios_base::sync_with_stdio(false);cin.tie(NULL);
#define endl '\n'
#define ff first
#define ss second
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
#define pb push_back
#define rew(i, a, b) for(int i = a; i < b; i++)
#define wer(i, a, b) for(int i = b - 1; i >= a; i--)
#define int long long
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef vector<pii> vii;

void solve(){
	int n, m, k;
	cin >> n >> m >> k;
	int ans = ((n/k)*(m/k));
	int f = 0;
	if(n%k > 0){
		ans += (n/k);
		f++;
	}if(m%k > 0){
		f++;
		ans += (m/k);
	}
	if(f==2){
		ans++;
	}
	cout << ans << endl;
}
main(){
	ios
	int t = 1;
	//~ cin >> t;
	while(t--){
		solve();
	}
}










