#include <iostream>
#include <fstream>
#include <vector>
#include <iomanip>
#include <algorithm>
#include <string>
#include <set>
#include <cmath>
#include <limits.h>
#include <map>
#include <sstream>
#include <deque>
#include <queue>
#include <valarray>
#include <array>
#include <unordered_map>

#define rep(i, st, n) for(int (i) = (st); (i) < (n); ++(i))
#define repb(i, st, n) for(bool (i) = (st); (i) < (n); ++(i))
#define all(a) (a).begin(), (a).end()
#define rall(a) (a).rbegin(), (a).rend()
#define pb push_back
#define nl "\n"

int const INF = 1e9 + 1000 - 7;

using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef string str;
typedef pair < int, int > pii;
typedef pair < ll, ll > pll;
typedef pair < ll, int > pli;
typedef vector <int> vi;
typedef vector < vector<int> > vvi;
typedef vector < pii > vpii;
typedef vector < pair<int, ll> > vpil;
typedef vector < ll > vll;


void solve() {
    ll n, m, k; cin >> n >> m >> k;
    ll ans = (n / k)* (m / k);
    if (n % k) ans += (m / k);
    if (m % k) ans += (n / k);
    cout << ans;
}

int main()
{
    cin.tie(0); ios::sync_with_stdio(0); cout.tie(0);
    int t = 1;// cin >> t;
    while (t--) {
        solve();
    }
}
