#include <iostream>
using namespace std;
#define ll long long

ll res, r, k, n, m;

int main(){
    cin >> n >> m >> k;
    res = (n / k) * (m / k);
    if((n % k) * (m % k) != 0)
        res += 1;
    if(n % k != 0){
        res += (m / k);
    }
    if(m % k != 0){
        res += (n / k);
    }
    cout << res;
}

