#include <iostream>

using namespace std;

using ll = long long;
using ld = long double;

#define int long long

void solve() {
    int n, m, k;
    cin >> n >> m >> k;
    int p = n / k;
    if(n % k)
        p++;
    int c = m / k;
    if (m % k)
        c++;
    cout << p * c << endl;
}

signed main()
{
    int t = 1;
    //cin >> t;
    //freopen("input.in", "r", stdin);
    while (t--) {
        solve();
    }
    return 0;
}

