I=input X=int(I()) Y=int(I()) L=int(I()) k = 2 if Y<0 else (X!=0) x = abs(X)//L+(X%L>0) y = abs(Y)//L+(Y%L>0) print(x+y+k)