//#include <bits/stdc++.h>
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <queue>
#include <unordered_set>
#include <unordered_map>
#include <bitset>
#include <cassert>
#include <cstring>
#include <cstddef>
#include <numeric>
#include <iterator>
#include <cmath>

#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math,O3")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,avx,mmx,tune=native")
//#include <ext/pb_ds/detail/standard_policies.hpp>
//#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
#define elif else if
#define pb push_back
#define fast cout.tie(nullptr); cin.tie(nullptr); ios_base::sync_with_stdio(false);
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define str to_string
#define sz(x) int(x.size())
using ll = long long;
using vl = vector<ll>;
#define ld long double
using ull = unsigned long long;
const int N = 1e6 + 1;
#define F first
#define S second
#define watch(x) cout << #x << " <----  " << x << endl
const int mod = 1e9 + 7;
const int INF = 1e9;

inline static void solve() {
    ll a, b, c, ans = 1;
    cin >> a >> b >> c;
    if (a % c == 0 and b % c == 0){
        ans = b * a / c /c;
    }
    if (a % c == 0 and b % c != 0){
        ans = a / c;
        ans *= (b/c) + 1;
    }
    if (a % c != 0 and b % c == 0){
        ans = b / c;
        ans *= (a/c) + 1;
    }
    if (a % c != 0 and b % c != 0){
        ans = (a/c) + 1;
        ans *= (b/c) + 1;
    }
    cout << ans;
}


int32_t main() {
    fast
    int tt = 1;
    //cin >> tt;
    while (tt--) {
        solve();
    }
}