#include <bits/stdc++.h>
#define fast_cin() ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
//    BASE
#define ll long long int
#define ed "\n"
#define pb push_back
#define _ " "
#define sz size()
#define ED cout << ed
//    for
#define fors_(s)  for(ll i = 0;i < s.size();i++)
#define for_(n)  for(ll i = 0;i < n;i++)
#define for__(j, n)  for(j;j < n;j++)
//    Vector
#define vec_(v) vector<ll>v;
#define cin_(v, n) for(ll i = 0;i < n;i++){ll x; cin >> x; v.pb(x);}
#define pri_(v) for(auto i : v){cout << i << _ ;} cout << ed;
#define all_(v) v.begin(),v.end()
//    Pair
#define par pair<ll, ll>
#define fi first
#define se second
typedef long double ld;
using namespace std;
int main() {

    ll n, m, k;
    cin >> n >> m >> k;


    ll len = (n + k - 1) / k;
    ll rows = (m + k - 1) / k;


    ll ans = len * rows;


    cout << ans << ed;

    return 0;
}
