#include <bits/stdc++.h>
#define pb push_back
#define ll long long
using namespace std;

const int N = 1e3 + 7;
const ll inf = 1e18;
const ll mod = 1e9 + 7;

ll n, m, k, a, b;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);

    cin >> n >> m >> k;

    a = n / k;
    b = m / k;

    if (n % k > 0) {
        a++;
    }

    if (m % k > 0) {
        b++;
    }

    cout << a * b;
}