fun main(args: Array<String>) {
  val sc = if (args.size > 1) java.util.Scanner(java.io.File(args[1])) else java.util.Scanner(System.`in`)
  solve(sc)
}

fun solve(sc: java.util.Scanner) {
  val a = sc.nextLong()
  val b = sc.nextLong()
  val x = sc.nextLong()
  val start = a / x + if (a % x == 0L) 0 else 1
  val end = b / x
  println(end - start + 1)
}
