import scala.io.StdIn._

object Main extends App {

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

  def solve() = {
    val ans = b/x - a/x
    if(a % x == 0) ans+1 else ans
  }

  println(solve())

}

