X = int(input()) Y = int(input()) L = int(input()) # X方向の移動回数 move_x = (abs(X) + L - 1) // L # Y方向の移動回数 move_y = (abs(Y) + L - 1) // L count = move_x + move_y # 方向転換 if (Y < 0) and (X != 0): count += 2 elif (Y >= 0) and (X != 0): count += 1 else: pass print(count)