#include <bits/stdc++.h>
#pragma GCC optimize(2)
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  long long n, m, s;
  cin >> n >> m >> s;
  long long a = n % s;
  long long b = m % s;
  long long c = n / s;
  long long d = m / s;
  if (a == 0)
    a = s;
  else
    c++;
  if (b == 0)
    b = s;
  else
    d++;
  cout << a * b * c * d << endl;
}
