#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>

#pragma GCC optimize("03")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("avx,avx2,bmi2,fma")

using namespace std;
//using namespace __gnu_pbds;

//gp_gash_table<int,int>mp;
#define ll long long
#define pb push_back
#define ld long double
#define endl '/n'
#define all(a) a.begin(), a.end()

const ll INF = 2e18, MOD = 1e9 + 7, MAXN = 2e5;

void solve() {
    ll n, m;
    cin >> n >> m;
    ll k;
    cin >> k;
    ll l = -1, r = n;
    while (r - l > 1) {
        ll mid = (l + r) / 2;
        if (mid * k >= n) {
            r = mid;
        } else {
            l = mid;
        }
    }
    ll res1 = r;
    l = -1, r = m;
    while (r - l > 1) {
        ll mid = (l + r) / 2;
        if (mid * k >= m) {
            r = mid;
        } else {
            l = mid;
        }
    }
    cout << r * res1;
}

int main() {
#ifdef LOCAL
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    ll t = 1;
    // cin >> t;
    while(t--) {
        solve();
    }
}
