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