#include <bits/stdc++.h>
#define int long long
using namespace std;
void solve(){
    int a, b, c;
    cin >> a >> b >> c;
    int h = a / c + a % c;
    int t = b / c + b % c;
    cout << h * t;

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