#include <bits/stdc++.h>
long long n, m, s;
int main() {
  scanf("%lld%lld%lld", &n, &m, &s);
  printf("%lld\n", ((n - 1) / s + 1) * ((m - 1) / s + 1) * ((n - 1) % s + 1) *
                       ((m - 1) % s + 1));
  return 0;
}
