#include <bits/stdc++.h>
using namespace std;
#define pi pair<int,int>
#define ll long long
#define ld long double
#define bg begin()
#define nd end()
#define sz size()
#define ers erase
#define ff first
#define ss second

ll binpow(ll a, ll x) {
    if (!x)
        return 1 ;
    if (x & 1)
        return a * binpow(a, x - 1) ;
    ll p = binpow(a, x / 2) ;
        return (p * p) ;
}

const int MAXN = (1 << 18) ;
const int INF = INT_MAX ;

int main() {
//freopen("input.in", "r", stdin) ;
//freopen("output.out", "w", stdout) ;
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int n, m, k ;
    cin >> n >> m >> k ;
    cout << (n / k + (n % k != 0)) * (m / k + (m % k != 0)) ;
}