X = int(input()) Y = int(input()) L = int(input()) dx = abs(X) dy = abs(Y) C = (dx // L) + (dy // L) if dx % L != 0: C += 1 if dy % L != 0: C += 1 turns = 0 if dx != 0 and dy != 0: turns = 1 elif dx != 0 and dy == 0: turns = 1 elif dx == 0 and dy != 0: turns = 0 C += turns print(C)