object Main extends App {
  val input = io.Source.stdin.getLines.toSeq.head.split(' ').map(_.toLong)
  val a=input(0)
  val b=input(1)
  val x=input(2)
  val ax=(a-1)/x
  val bx=b/x
  val ret=bx-ax
  println(ret)
}
