#include int main(void){ int x,y,l,r=0; scanf("%d%d%d",&x,&y,&l); if(y < 0){y*=-1;r+=2;} if(x < 0){x*=-1;} if(x != 0){r++;} if(x%l){r+=(1+(x/l));}else{r+=(x/l);} if(y%l){r+=(1+(y/l));}else{r+=(y/l);} printf("%d\n",r); return 0; }