X=int(input()) Y=int(input()) L=int(input()) ans=(abs(X)+L-1)//L+(abs(Y)+L-1)//L if Y>=0: if X!=0: ans+=1 else: ans+=2 print(ans)