#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, s, i;
  scanf("%d %d %d", &n, &m, &s);
  int row = 0, col = 0;
  int sum1 = 0, sum2 = 0;
  for (i = 1; i <= n; i++) {
    row = max(row, (i - 1) / s + (n - i) / s);
  }
  for (i = 1; i <= n; i++) {
    if ((i - 1) / s + (n - i) / s == row) sum1++;
  }
  for (i = 1; i <= m; i++) {
    col = max(col, (i - 1) / s + (m - i) / s);
  }
  for (i = 1; i <= m; i++) {
    if ((i - 1) / s + (m - i) / s == col) sum2++;
  }
  printf("%lld\n", 1ll * sum1 * sum2);
  return 0;
}
