It is known that fleas in Berland can jump only vertically and horizontally, and the length of the jump is always equal to s centimeters. A flea has found herself at the center of some cell of the checked board of the size n × m centimeters (each cell is 1 × 1 centimeters). She can jump as she wishes for an arbitrary number of times, she can even visit a cell more than once. The only restriction is that she cannot jump out of the board.

The flea can count the amount of cells that she can reach from the starting position (x, y). Let's denote this amount by dx, y. Your task is to find the number of such starting positions (x, y), which have the maximum possible value of dx, y.

Input

The first line contains three integers n, m, s (1 ≤ n, m, s ≤ 106) — length of the board, width of the board and length of the flea's jump.

Output

Output the only integer — the number of the required starting positions of the flea.

Examples

Input

2 3 1000000


Output

6


Input

3 3 2


Output

4
#include <bits/stdc++.h>
const long double pi = 3.1415926535897932384626433832795;
using namespace std;
unsigned long long int leftRotate(unsigned long long int n,
                                  unsigned long long int d) {
  return (n << d) | (n >> (16 - d));
}
unsigned long long int rightRotate(unsigned long long int n,
                                   unsigned long long int d) {
  return (n >> d) | (n << (16 - d));
}
int log2(int x) {
  int res = 0;
  while (x >>= 1) res++;
  return res;
}
long long int comb(long long int n, long long int r) {
  if (r == 0 || r == n) return 1;
  return comb(n - 1, r) + comb(n - 1, r - 1);
}
bool isPowerOfTwo(int n) {
  if (n == 0) return false;
  return (ceil(log2(n)) == floor(log2(n)));
}
long long int inverse(long long int a, long long int m) {
  return 1 < a ? m - inverse(m % a, a) * (m / a) : 1;
}
long long int issorted(long long int arr[], long long int n) {
  if (n == 1 || n == 0) return 1;
  if (arr[n - 1] < arr[n - 2]) return 0;
  return issorted(arr, n - 1);
}
int computeXOR(int n) {
  if (n % 4 == 0) return n;
  if (n % 4 == 1) return 1;
  if (n % 4 == 2)
    return n + 1;
  else
    return 0;
}
long long int count(string s) {
  long long int ans = 1, i, j;
  for (i = 1; i < s.length(); i++) {
    for (j = 0; j < i; j++) {
      if (s[i] == s[j]) break;
    }
    if (i == j) ans++;
  }
  return ans;
}
bool isPerfectSquare(long double x) {
  long double sr = sqrt(x);
  return ((sr - floor(sr)) == 0);
}
long long int countarray(long long int a[], long long int n) {
  unordered_set<long long int> s;
  for (long long int i = 0; i < n; i++) s.insert(a[i]);
  return s.size();
}
bool check(int N) {
  long long int i;
  if (N & (1 << i))
    return true;
  else
    return false;
}
bool isvowel(char ch) {
  string s = "aeiouAEIOU";
  for (char c : s) {
    if (c == ch) {
      return true;
    }
  }
  return false;
}
bool isPrime(long long int n) {
  if (n <= 1) return false;
  if (n <= 3) return true;
  if (n % 2 == 0 || n % 3 == 0) return false;
  for (long long int i = 5; i * i <= n; i = i + 6)
    if (n % i == 0 || n % (i + 2) == 0) return false;
  return true;
}
struct interval {
  int start, end;
};
bool compare(interval x, interval y) { return (x.start < y.start); }
bool isSubstring(string s1, string s2) {
  int M = s1.length();
  int N = s2.length();
  for (int i = 0; i <= N - M; i++) {
    int j;
    for (j = 0; j < M; j++)
      if (s2[i + j] != s1[j]) break;
    if (j == M) return true;
  }
  return false;
}
int seive(int n) {
  bool isprime[n + 1];
  for (int i = 2; i <= n; i++) isprime[i] = true;
  isprime[0] = false;
  isprime[1] = false;
  for (int i = 2; i <= sqrt(n); i++) {
    if (isprime[i] == true) {
      for (int j = i * i; j <= n; j += i) {
        isprime[j] = false;
      }
    }
  }
  int count = 0;
  for (int i = 0; i <= n; i++) {
    if (isprime[i] == true) count++;
  }
  return count;
}
void multiply(int a[2][2], int m[2][2]) {
  int him[2][2];
  for (int i = 0; i < 2; i++) {
    for (int j = 0; j < 2; j++) {
      him[i][j] = 0;
      for (int k = 0; k < 2; k++) {
        him[i][j] += (a[i][k] * m[k][j]);
      }
    }
  }
  for (int i = 0; i < 2; i++) {
    for (int j = 0; j < 2; j++) {
      a[i][j] = him[i][j];
    }
  }
}
void power(int a[2][2], int n) {
  if (n == 0 || n == 1) return;
  power(a, n / 2);
  multiply(a, a);
  if (n % 2 != 0) {
    int m[2][2] = {{1, 1}, {1, 0}};
    multiply(a, m);
  }
}
int fib(int n) {
  int a[2][2] = {{1, 1}, {1, 0}};
  if (n == 0) return 0;
  power(a, n - 1);
  return a[0][0];
}
int factmod(int n, int p) {
  int res = 1;
  while (n > 1) {
    res = (res * ((n / p) % 2 ? p - 1 : 1)) % p;
    for (int i = 2; i <= (n % p); i++) res = (res * i) % p;
    n /= p;
  }
  return res % p;
}
long long int modularexponentiation(long long int a, long long int n) {
  long long int res = 1;
  while (n > 0) {
    if (n & 1) res = ((res % 1000000007) * (a % 1000000007)) % 1000000007;
    n /= 2;
    a = ((a % 1000000007) * (a % 1000000007)) % 1000000007;
  }
  return res;
}
long long int largest_power(long long int N) {
  N = N | (N >> 1);
  N = N | (N >> 2);
  N = N | (N >> 4);
  N = N | (N >> 8);
  N = N | (N >> 16);
  return (N + 1) >> 1;
}
bool alternate(long long int n) {
  long long int i;
  if ((n ^ (n >> 1)) == (pow(2, i) - 1)) return true;
  return false;
}
long long int countDivisors(long long int n) {
  long long int cnt = 0;
  for (long long int i = 1; i <= sqrt(n); i++) {
    if (n % i == 0) {
      if (n / i == i)
        cnt++;
      else
        cnt = cnt + 2;
    }
  }
  return cnt;
}
int highestpowerof2(int n) { return (n & (~(n - 1))); }
void lowertoupper(char ch) {
  ch = ch & '_';
  cout << ch << " ";
}
void uppertolower(char ch) {
  ch = ch | ' ';
  cout << ch << " ";
}
long long int primecounter(long long int l, long long int r) {
  long long int fact = 1, count = 0;
  for (long long int i = l; i <= r; i++) {
    if (((fact - i) % ((1LL << i) - 1)) == 0) count++;
    fact *= ((1LL << i) - 1);
  }
  return count;
}
long long int counteprime(long long int l, long long int r) {
  long long int count = 0, i, j;
  for (i = l; i <= r; i++) {
    for (j = 2; j <= (i / j); j++) {
      if (!(i % j)) break;
    }
    if (j > (i / j)) count++;
  }
  return count;
}
void pairsort(int a[], char b[], int n) {
  pair<int, char> pairt[n];
  for (int i = 0; i < n; i++) {
    pairt[i].first = a[i];
    pairt[i].second = b[i];
  }
  sort(pairt, pairt + n);
  for (int i = 0; i < n; i++) {
    a[i] = pairt[i].first;
    b[i] = pairt[i].second;
  }
}
long long int fibo(long long int n) {
  long double him = (1 + sqrt(5)) / 2;
  return round(pow(him, n) / sqrt(5));
}
long long int binToDec(string c) {
  long long int count = 0;
  for (long long int i = 0; i < c.length(); i++) {
    if (c[i] == '1') {
      long long int val = 1;
      for (long long int j = 0; j < i; j++) {
        val *= 2;
      }
      count += val;
    }
  }
  return count;
}
void rev(int a[], int n) {
  for (long long int i = 0, j = n - 1; i < j; i++, j--) {
    swap(a[i], a[j]);
  }
  for (int i = 0; i < n; i++) cout << a[i] << " ";
}
long long int representative[100005];
long long int size[100005];
vector<pair<pair<long long int, long long int>, long long int>> adj;
long long int find(long long int x) {
  if (representative[x] == x) return x;
  return representative[x] = find(representative[x]);
}
bool same(long long int a, long long int b) { return find(a) == find(b); }
void unions(long long int a, long long int b) {
  a = find(a);
  b = find(b);
  if (a == b) return;
  if (size[a] > size[b]) {
    size[a] += size[b];
    representative[b] = a;
  } else {
    size[b] += size[a];
    representative[a] = b;
  }
}
int main() {
  long long int n, m, s;
  cin >> n >> m >> s;
  if (s >= n && s >= m) {
    cout << n * m << endl;
  } else {
    long long int c = ((n - 1) % s) + 1;
    c = c * (ceil(n / (s * (1.0))));
    long long int c2 = ((m - 1) % s) + 1;
    c2 = c2 * (ceil(m / (s * (1.0))));
    cout << c * c2;
  }
}
