#include <bits/stdc++.h> 
using namespace std;
int main () {
    long long n, m, k;
    cin >> n >> m >> k;
    long long s1 = n / k, s2 = m / k;
    if (n%k!=0){
        s1=n/k+1;
    }
    if (m%k!=0){
        s2=m/k+1;
    }
    int s=s1*s2;
    if (n%k==0 && m%k==0){
        cout<<n*m/(k*k);
     
    }
    else{
        cout<<s;
    }    
}
