#include "bits/stdc++.h"

using namespace std;

signed main() {
    int n, m, k, temp, temp1;
    cin >> n >> m >> k;
    if (k > n and k > m) {
        cout << 1;
        return 0;
    }
    if (n % k == 0)
        temp = n / k;
    else
        temp = n / k + 1;
    if (m % k == 0)
        temp1 = m / k;
    else
        temp1 = m / k + 1;
    cout << temp * temp1;

}