#include <bits/stdc++.h>
#define ent '\n'
#define f first
#define s second

using namespace std;
typedef long long ll;
typedef pair < int, int > pii;
typedef pair < ll, ll > pll;

const int maxn = 2e5 + 100;
const int mod = 1e9 + 7;

ll n , m , k;

void solve(){
    cin >> n >> m >> k ;
    if(n % k == 0 && m % k == 0){
        cout << n/k * m/k ;
    }
    else if(n % k == 0 && m % k != 0){
        cout << n / k * m / k + n/k;
    }
    else if(n % k != 0 && m % k == 0){
        cout << n / k * m / k + m/k;
    }
    else cout << (n + k - 1) / k * (m + k - 1) / k;
}

int main(){ 
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    int T = 1;
    // cin >> T;
    for(int i = 1;i <= T;i++){
        solve();
    }
}
