#include <iostream>

using namespace std;

int main()
{
    long long  n, m, k, l;
    cin >> n >> m >> k;
    if (n < k and m <k){
        cout << "1";
    }
    else if (n < k){
        l = long(m/k)+(m%k);
        cout << abs(l);
    }
    else if(m < k){
        l = long(n/k)+(n%k);
        cout << abs(l);
    }
    else{
        l = (long(n/k)+(n%k))*(long(m/k)+(m%k));
    cout << abs(l);
    }
    
    

    return 0;
}
