//#pragma GCC optimize("Ofast")
//#pragma GCC target("avx,avx2,fma")
//#pragma GCC optimization("unroll-loops") 


//#include <bits/stdc++.h>
#include <algorithm>
#include <cmath>
#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <deque>
#include<stack>
#include<string>
#include<string.h>
#include<set>
#include<map>
#include<bitset>
#include<stdlib.h>
#include<cassert>
#include<time.h>
#include<bitset>


#define ll long long
#define boost ios_base::sync_with_stdio(NULL);cin.tie(0);cout.tie(0)
using namespace std;


int main()
{
 //freopen("input.txt", "r", stdin);
    ///freopen("output.txt", "w", stdout);
 boost;
    ll a,b,k;
 cin >> a >> b >> k;
 
 ll ans = a / k;
 ll sum = b / k;
 if (a%k > 0)
 ans++;
 if(b % k > 0)
 sum++;
 
 cout << sum * ans <<  endl;
 
}