#include <iostream>

using namespace std;

int main() {
    int n, m, k;
    cin >> n >> m >> k;

    
    int m_div = m / k;
    int m_mod = m % k;
    int n_div = n / k;
    int n_mod = n % k;

    
    int total = (m_div * n_div) + (m_div * m_mod) + (n_div * n_mod);

    cout << total << endl;

    return 0;
}