X, Y, L = int(raw_input()), int(raw_input()), int(raw_input()) order = 0 currentPosition = (0, 0) def countTurn(x, y): global order if currentPosition == (x, y): order = 0 else: if x == 0 and y > 0: order = 0 else: if y >= 0: order += 1 else: order += 2 def countMoveFoward(n): global order n = abs(n) if n != 0: if n <= L: order += 1 else: if n % L == 0: order += n/L else: order += n/L + 1 pass countTurn(X, Y) countMoveFoward(X) countMoveFoward(Y) print order