#include <bits/stdc++.h>
using namespace std ;
signed main()
{
    int n , m, k;
    cin >> n >> m >> k;
    int t , y , u;
    if( n % k != 0 ){
        t = ( n / k ) + 1;
    }
    if( m % k != 0 ){
        y = ( m / k ) + 1;
    }
    if( n % k == 0 ){
        t = n / k;
    }
    if( m % k == 0 ){
        y = m / k;
    }
    cout << y * t;
}
