#include <time.h>
#include <cstdlib>
#include <stack>
#include <numeric>
#include <unordered_map>
#include <unordered_set>
#include <iomanip>
#include <map>
#include <set>
#include <iterator>
#include <deque>
#include <queue>
#include <sstream>
#include <array>
#include <string>
#include <tuple>
#include <chrono>
#include <cassert>
#include <cstdio>
#include <cstring>
#include <list>
#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <bitset>
#define ll long long
using namespace std;

int tt = 1;
int main(){
    ios::sync_with_stdio(0);
    cin.tie(0), cout.tie(0);
    long long n, m, k;
    cin >> n >> m >> k;
    ll ans = (n / k) * (m / k) + min(1ll, n % k) * (m / k) + min(1ll, m % k) * (n / k);
    if(m % k != 0 && n % k != 0) ans++;
    cout << ans;
}
