typedef long long ll;
typedef long double ld;

#define all(a) a.begin(), a.end() 
#define rall(a) a.rbegin(), a.rend() 
#define love ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0) 


#include <iostream> 
#include <vector> 
#include <algorithm> 
#include <cmath> 
#include <set> 
#include <map> 
#include <string> 
#include <unordered_map> 

const std::string Alp = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
const std::string alp = "abcdefghijklmnopqrstuvwxyz";
const ll mod1 = 1e9 + 9;
const ll p1 = 47;
const ll mod2 = 1e9 + 1000 - 7;
const ll p2 = 41;

using namespace std;


void solveA() {
    ll n, m, k;
    cin >> n >> m >> k;
    cout << (n / k + (n % k != 0)) * (m / k + (m % k != 0));
}


void solve() {
    ll a, b;
    cin >> a >> b;

    ll out = a * b;
    if (a < b) swap(a, b);
    for (int i = 0; i < a; i++) {
        // (5 + 4 + 3 + 2) * 2 
        if (b == 1) out += 1;
        else out += (b + 2) * (b - 1);
    }
    cout << out;
}


int main() {
    love; // ❤❤❤ 
    int t = 1;
    // cin >> t; 
    while (t--) {
        solveA();
        cout << "\n";
    }
}