#include <bits/stdc++.h>
using namespace std;
long long n, i, j, ans = 0;
map<long long, long long> M;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n, m, s;
  cin >> n >> m >> s;
  if (s >= max(n, m)) return cout << n * m, 0;
  long long row = s, col = s, x, y;
  if (n % s != 0) row = n % s;
  if (m % s != 0) col = m % s;
  x = n / s, y = m / s;
  if (n % s != 0) x++;
  if (m % s != 0) y++;
  cout << x * y * row * col;
}
