x = int(input()) y = int(input()) l = int(input()) if x == 0: if y >= 0: ans = (y+l-1)//l print(ans) exit() else: ans = (-y+l-1)//l+1 print(ans) exit() if y == 0: if x > 0: ans = (x+l-1)//l+1 print(ans) exit() elif x == 0: print(0) exit() else: ans = (-x+l-1)//l+1 print(ans) exit() if x > 0 and y > 0: ans = (y+l-1)//l+1+(x+l-1)//l elif x < 0 and y > 0: ans = (y+l-1)//l+1+(-x+l-1)//l elif x < 0 and y < 0: ans = 1+(-x+l-1)//l+1+(-y+l-1)//l else: ans = 1+(x+l-1)//l+1+(-y+l-1)//l print(ans)