import scala.io.StdIn

object Main extends App {

  val Array(a, b, x) = StdIn.readLine().split(" ").map(_.toLong)

  val ai = a / x
  val bi = b / x
  println(bi - ai + (if (a % x == 0) 1 else 0))
  
}