object Main extends App {
  val Array(a, b, x) = scala.io.StdIn.readLine().split(' ').map(_.toLong)
  var start = 0L

  if (a % x == 0) {
    start = a
  } else {
    start = a + x - a % x
  }
  if (b > start) {
    println((b - start) / x + 1)
  } else {
    println(0)
  }
}
