X=int(input()) Y=int(input()) L=int(input()) cnt=0 if (Y>0 and X<0) or (Y>0 and X>0): cnt=1 if Y%L==0: cnt+=Y//L else: cnt+=Y//L+1 if abs(X)%L==0: cnt+=abs(X)//L else: cnt+=abs(X)//L+1 elif Y>0 and X==0: if Y%L==0: cnt+=Y//L else: cnt+=Y//L+1 if (Y<0 and X<0) or (Y<0 and X>0): cnt=2 if abs(Y)%L==0: cnt+=abs(Y)//L else: cnt+=abs(Y)//L+1 if abs(X)%L==0: cnt+=abs(X)//L else: cnt+=abs(X)//L+1 elif Y<0 and X==0: cnt+=2 if abs(Y)%L==0: cnt+=abs(Y)//L else: cnt+=abs(Y)//L+1 elif (Y==0 and X>0) and (Y==0 and X<0): cnt+=1 if abs(X)%L==0: cnt+=abs(X)//L else: cnt+=abs(X)//L+1 elif Y==0 and X==0: cnt=0 print(cnt)