def f(x):x=abs(x);return x//L+(x%L!=0) def i():return int(input()) X,Y,L=i(),i(),i();p=Y<0;print(p+(p,1)[X!=0]+f(X)+f(Y))