#include <bits/stdc++.h>
using namespace std;
int main ()
{int n,m,k,p=0;
cin>>n>>m>>k;
int s=k;
while(s*s<=n*m){
s+=k;}
if(s*s!=n*m)s-=k;
p+=s*s/(k*k);
if(n-s>0)
    p+=m/k;
if(m-s>0)
    p+=n/k;
cout<<p;
return 0;}