#include <bits/stdc++.h>
using namespace std;
long long n, m, a, k, l;
void solve() {
  cin >> n >> m >> a;
  k = m / a;
  l = n / a;
  if (k * a != m) k++;
  if (l * a != n) l++;
  cout << l * k << "\n";
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  solve();
}
