#include <iostream>
#include <vector>

using namespace std;
 
typedef long long ll;

#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math,O3")
#pragma GCC target ("avx2")
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")
#pragma optimization_level 3
 
// Defines
 
#define pb push_back // kak push_back 5
#define endl '\n'
#define FOR(i,start,end) for(int i = start;i < end;i ++)
#define REV(i,start,end) for(int i = start;i >= end;i --)
#define precal(x) fixed << setprecision(x)
#define F first
#define S second
#define sz(x) (ll)x.size()
#define all(x) (x).begin(),(x).end()
#define m_p make_pair
#define mt make_tuple
#define str to_string

// #ifndef ONLINE_JUDGE
//     #define cerr if(false) cerr
// #endif
 
const ll mxn = 1e6;
const ll k = 400;
// const ll org = 10000;
const ll inf = 1e9 + 7;
// const ll mod = 998244353;

ll a[mxn],n,cnt = 0;

bool sosed[mxn],pr[mxn],used[mxn];

vector <ll> v[mxn];

int main(){
    // freopen("sparse.in","r",stdin);
    // freopen("sparse.out","w",stdout);
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    ll tt = 1;
    // cin >> tt; 
    while(tt --){
    	ll n,m,k;
        cin >> n >> m >> k;
        ll ans = (n / k) * (m / k);
        if(m % k == 0 && n % k == 0){
            cout << ans;
        }
        else if(m % k == 0){
            cout << ans + m / k;
        }
        else if(n % k == 0){
            cout << ans + n / k;
        }
        else cout << ans + n / k + m / k - 1;
    }
}
