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