object Main {
  def main(args: Array[String]): Unit = {
    import scala.io.StdIn.readLine
    val Array(datA, datB, datX) = readLine.split(" ").map(_.toLong)
    val ans = (datB / datX) - (datA / datX) + (if(datA % datX == 0) 1 else 0)
    println(ans)
  }
}
