// by Diar Esbol
#include <iostream>
#include <cmath>
#include <climits>
#include <set>
#include <map>
#include <iomanip>
#include <vector>
#include <string>
#include <algorithm>
#include <utility>
#include <queue>
#include <numeric>
#include <stack>
#include <assert.h>
#include <intrin.h>

using namespace std;
 
#define ll long long
#define ld long double
#define pb push_back
#define pop_b pop_back
#define all(x) x.begin(), x.end()
#define ull unsigned long long
 
const ll maxv = 1550, mod = 1e9 + 7, inf = 2e9;

void booster( ) {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
}

ll binpow(ll a, ll b) {
    if (b == 0) return 1;
    else if (b % 2 != 0) {
        return binpow(a, b - 1) * a;
    }
    else {
        ll xd = binpow(a, b / 2);
        return b * b;
    }
}
ll lcm(ll a, ll b) {
    return abs(a * b) / gcd(a, b);
}

void solve( ) {
    booster( );
    ll n,m,k;
    ll fir,sec;
    cin >> n >> m >> k;
    if(n % k == 0) fir = n/k;
    else fir = n/k+1;
    if(m%k == 0) sec = m/k;
    else sec = m/k+1;
    cout << fir * sec;
}
int main( ) {
    booster( );
    int testcases = 1;
    //cin >> testcases;
    while (testcases--) {
        solve( );
    }
    return 0;
}
