#include <bits/stdc++.h>
using namespace std;
int main()
{
    int n, m, k; cin >> n >> m >> k;
    int64_t ans, ans2;
    if (n % k != 0)
    {
        ans = n / k + 1;
    }
    else
    {
        ans = n / k;
    }
    if (m % k != 0)
    {
        ans2 = m / k + 1;
    }
    else
    {
        ans2 = m / k;
    }
    cout<<ans * ans2;


}
