import java.util.Scanner

object Main extends App{
  val sc = new Scanner(System.in )

  val a = sc.nextLong
  val b = sc.nextLong
  val x = sc.nextLong

  val res = b / x - (a - 1L) / x

  println(res)
}


