X,Y,L=[int(input()) for _ in '1'*3] X=abs(X) a=((Y<0),1)[X!=0] if Y<0:Y=-Y;a+=1 print(a+X//L+(X%L!=0)+Y//L+(Y%L!=0))