#include <bits/stdc++.h>

using namespace std;
using ll = long long;
using ull = unsigned long long;

void solve() {
    int k, n, m;
    cin >> n >> m >> k;
    if (m % k == 0) {
        if (n % k == 0)
            cout << (m / k) * (n / k);
        else
            cout << (m / k) * (n / k + 1);
    } else {
        if (n % k == 0) {
            cout << ((m / k) + 1) * (n / k);
        } else {
            cout << ((m / k) + 1) * (n / k) + 1;
        }
    }
}

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

