#include <bits/stdc++.h>
using namespace std;
 
int main(){
    long long n, m, k;
    cin >> n >>m >>k;
    bool x = (n % k != 0);
    bool y = (m % k != 0);
    cout << (n / k) * (m / k) + x * (m /k + y) + y * (n / k + x) - x * y;
    return 0;
}
