#include <bits/stdc++.h>
using namespace std;
int R, C, s;
int main() {
  scanf("%d %d %d", &R, &C, &s);
  long long int mi = 0, mj = 0;
  long long int lx = 0;
  for (int i = 0; i < C; i++)
    lx = max(lx, (long long int)((C - i - 1) / s + i / s + 1));
  for (int i = 0; i < C; i++)
    if ((C - i - 1) / s + i / s + 1 == lx) mi++;
  long long int ly = 0;
  for (int i = 0; i < R; i++)
    ly = max(ly, (long long int)((R - i - 1) / s + i / s + 1));
  for (int i = 0; i < R; i++)
    if ((R - i - 1) / s + i / s + 1 == ly) mj++;
  long long int ans = mi * mj;
  printf("%lld", ans);
}
