import math X=int(input()) Y=int(input()) L=int(input()) N=0 if X!=0 and Y>0: N=math.ceil(Y/L)+math.ceil(abs(X)/L)+1 elif X==0 and Y>0: N=math.ceil(Y/L) elif X!=0 and Y<0: N=math.ceil(abs(Y)/L)+math.ceil(abs(X)/L)+2 elif X==0 and Y<0: N=math.ceil(abs(Y)/L)+2 elif X!=0 and Y==0: N=math.ceil(abs(X)/L)+1 elif X==0 and Y==0: N=0 print(N)