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