#pragma GCC optimize ("03,unroll-loops")
//#pragma GCC target ("avx,avx2,bmi,bmi2,lzcnt,popcnt")
#include <bits/stdc++.h>

using namespace std;
#define int long long
#define foru(i, x, n) for (int i = x; i < n; i++)
#define ford(i, x, n) for (int i = x; i >= n; i--)
#define forn(i, n) for (int i = 0; i < n; i++)
#define pb push_back
#define ft first
#define sd second
#define elif else if
#define fast ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);

template <typename T, typename Y>
istream& operator>> (istream& in, pair<T, Y>& a) {
    in >> a.first >> a.second;
    return in;
}

template <typename T>
istream& operator>> (istream& in, vector<T>& a) {
    forn(i, a.size())
        in >> a[i];
    return in;
}

template<typename T>
ostream& operator<< (ostream& out, vector<T>& a) {
    out << a[0];
    foru(i, 1, a.size())
        out << ' ' << a[i];
    out << '\n';
    return out;
}

const int MAX=1e9+1;
const double EPS = 1e-9;

void solve() {
    int n, m, k, a, b;
    cin >> n >> m >> k;
    //a = n/k + (n%k != 0?1:0);
    //b = m/k + (m%k != 0?1:0);
    int rez = n / k * m / k;
    if (n % k && m % k)
        rez += m / k + n / k + 1;
    else if (n % k)
        rez += m / k;
    else if (m % k)
        rez += n / k;

    cout << rez;
}

signed main()
{
    fast;
    int t = 1;
    //cin >> t;
    while (t--)
        solve();
    return 0;
}
