X = int(input()) Y = int(input()) L = int(input()) import math if X == 0 and Y == 0: print(0) elif X == 0 and Y > 0 : y = math.ceil(Y / L) print(y) elif X == 0 and Y < 0: y = math.ceil(abs(Y) / L) print(y + 2) elif X > 0 and Y == 0: x = math.ceil(X / L) print(x + 1) elif X > 0 and Y > 0: x = math.ceil(X / L) y = math.ceil(Y / L) print(x + y + 1) elif X > 0 and Y < 0: x = math.ceil(X / L) y = math.ceil(abs(Y) / L) print(x + y + 2) elif X < 0 and Y == 0: x = math.ceil(abs(X) / L) print(x + 1) elif X < 0 and Y > 0: x = math.ceil(abs(X) / L) y = math.ceil(Y / L) print(x + y + 1) elif X < 0 and Y < 0: x = math.ceil(abs(X) / L) y = math.ceil(abs(Y) / L) print(x + y + 2)