/***> @author : a_e_kasem <***/
// ﷽
// { وَأَنْ لَيْسَ لِلْإِنْسَانِ إِلَّا مَا سَعَى }
//
// فَالجُهدُ يُثمِرُ إنْ تَضافَرَ صَفوُهُ، والعَزمُ يَرفعُ صَرحَ كُلِّ بُنيانِ
//
// وَما نَيلُ المَطالِبِ بِالتَمَنّي
// وَلَكِن تُؤخَذُ الدُنيا غِلابا
// ***
// وَما اِستَعصى عَلى قَومٍ مَنالٌ
// إِذا الإِقدامُ كانَ لَهُم رِكابا
//
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define cinAll(a) for (auto &it : a) cin >> it
#define all(x) (x).begin(), (x).end()
#define NO void(cout << "NO\n")
#define YES void(cout << "YES\n")
struct custom_hash {
static uint64_t splitmix64(uint64_t x) {
// http://x...content-available-to-author-only...i.it/splitmix64.c
x += 0x9e3779b97f4a7c15;
x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
return x ^ (x >> 31);
}
size_t operator()(uint64_t x) const {
static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
return splitmix64(x + FIXED_RANDOM);
}
};
void solve() {
int n, m, a; cin >> n >> m >> a;
int ans = 0;
if (n % a == 0) ans += n/a;
else ans += (n / a)+1;
if (m % a == 0) ans *= m/a;
else ans *= (m / a)+1;
cout << ans << '\n';
}
void FastIO();
int32_t main() {
FastIO();
int t = 1;
// cin >> t;
while(t--)
{
solve();
}
return 0;
}
void FastIO()
{
// freopen("input.txt", "r", stdin);
// freopen("output.txt", "w", stdout);
ios::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
}