i=input;X,Y,L=map(int,(i(),i(),i()));f=lambda x:abs(x)//L+(x%L!=0);print((X!=0,2)[Y<0]+f(X)+f(Y))