#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC optimize("no-stack-protector")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,popcnt,abm,mmx,tune=native")
#pragma GCC optimize("fast-math")
#pragma GCC target("avx,avx2,fma")

#define int long long
#define damkk ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0) ;
#define pb push_back
#define sz size()
#define F first
#define S second
#define file(s) if (fopen(s".in", "r")) freopen(s".in", "r", stdin), freopen(s".out", "w", stdout);
#define all(s) (s).begin(),(s).end()
#define yes cout << "YES\n";
#define no cout << "NO\n";
#define yes cout << "Yes\n";
#define no cout << "No\n";

using namespace std ;

const int MaxN = 100010;
const int inf = 1e9 + 99;
const int MOD = 1e9 + 7 ;
const long double eps = 1e-6;

int binpow(int a , int b){
	if(b == 0){
		return 1;
	}
	if(b % 2 == 1){
		return binpow(a , b - 1) * a % MOD;
	}
	else{
		int val = binpow(a , b / 2);
		return val * val % MOD;
	}
}

void solve(){
	int n , m , k;
    cin >> n >> m >> k;
    int cnt = n / k , cnt2 = m / k;
    if(n % k >= 1){
      	cnt++;
  	}
  	if(m % k > 0){
    	cnt2++;
  	}
  	cout << cnt * cnt2 << '\n';
}

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


