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