object Main extends App {
  val inputs: Seq[String] = scala.io.Source.stdin.getLines().toList
  
  val nums = inputs.head.split(" ").map(_.toLong)
  val a = nums(0)
  val b = nums(1)
  val x = nums(2)

  println(solve(a, b, x))

  private def solve(a: Long, b: Long, x: Long): Long = {
    val sur = a % x
    val firstDiv = a + sur

    if (b < firstDiv) {
      return 0
    }

    return (b - firstDiv) / x + 1
  }
}