#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
const int MX = 2e5 + 2;
const long long INF = 1000000000000000000;
const long double PI = 4 * atan((long double)1);
const int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
bool tkmin(int a, int b) { return b < a ? a = b, true : false; }
bool tkmax(int a, int b) { return b > a ? a = b, true : false; }
int rudiv(int a, int b) { return a / b + !(a % b == 0); }
void op(int ok) { cout << ok << endl; }
void op(string ok) { cout << ok << endl; }
void op(long long ok) { cout << ok << endl; }
void op(char ok) { cout << ok << endl; }
void op(double ok) { cout << fixed << setprecision(7) << ok << endl; }
void op(long double ok) { cout << fixed << setprecision(7) << ok << endl; }
void op(pair<int, int> ok) { cout << ok.first << " " << ok.second << endl; }
void op(pair<long long, long long> ok) {
  cout << ok.first << " " << ok.second << endl;
}
void op(pair<long double, long double> ok) {
  cout << ok.first << " " << ok.second << endl;
}
long long n, m, second;
int main() {
  std::ios::sync_with_stdio(false);
  cin.tie(0);
  ;
  cin >> n >> m >> second;
  if (second == 1) {
    cout << n * m;
    return 0;
  }
  if (second >= m && second >= n) {
    cout << n * m;
  }
  if (second >= m && second < n) {
    if (n % second != 0)
      cout << (n % second) * (n / second + 1) * m;
    else
      cout << n * m;
  }
  if (second >= n && second < m) {
    if (m % second != 0)
      cout << (m % second) * (m / second + 1) * n;
    else
      cout << n * m;
  }
  if (second < n && second < m) {
    if (n % second != 0 && m % second != 0)
      cout << (m % second) * (m / second + 1) * (n % second) * (n / second + 1);
    else if (n % second != 0)
      cout << (n % second) * (n / second + 1) * m;
    else if (m % second != 0)
      cout << (m % second) * (m / second + 1) * n;
    else
      cout << n * m;
  }
  return 0;
}
