#include <iostream>

    using namespace std;

    int main()
    {
        long long n;
        long long m;
        long long k, a, b;
        cin >> n;
        cin >> m;
        cin >> k;

        if (n % k != 0)
            a = n / k + 1;
        else
            a = n / k;

        if (m % k != 0)
            b = m / k + 1;
        else
            b = m / k;

        cout << a * b;

        return 0;
    }
    