X,Y,L=[int(input())for x in'...'] print(abs(X)//L+(X%L>0)+abs(Y)//L+(Y%L>0)+(2 if Y<0 else (X!=0)))