#include <bits/stdc++.h>

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

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

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();
}

