#include <bits/stdc++.h>

#define int long long
#define ll long long
#define all(x) x.begin() , x.end()
#define F first
#define S second
#define sz size()
#define dibamboo ios::sync_with_stdio(0); cin.tie(0);
#define pb push_back
#define ins insert
#define nol (int)0
#define gcd(a , b) __gcd(a , b)                                                                                                                                                                 

using namespace std;

const int inf = 1e9;
const int MOD = 1e9+7;
const int N = 1e5+3 , N1 = 1e3+3;
const long double eps = 1e-11;

//int bp[N] , fact[N];

//int cnk(int n , int k){
//	return fact[n] * bp[k] * bp[n - k];
//}

ll pp(int v , int k){
	if(k == 0) return 1;
	if(k % 2 != 0) return pp(v , k - 1) * v % MOD;
	int val = pp(v , k / 2);
	return val * val % MOD;
}



void code(){
	int n , m ,k;
	cin >> n >> m >> k;
	cout << ((n / k) + (n % k)) * ((m / k) + (m % k));
}



signed main(){
	dibamboo
//	cout.tie(0);
//    freopen("hps.in" , "r" , stdin);
//    freopen("hps.out" , "w" , stdout);
//    fact[0] = bp[0] = 1;
    int tt = 1;
//    cin >> tt;
	for(int id111 = 1; id111 <= tt; id111++){
//		cout << "Case " << id111 << ": ";
		code();
	}
}