
fun main(arr:Array<String>) {
    val (a,b,x) =  readLine()!!.split(" ").map { it.toLong() }
    val min = (a / x + (if(a%x == 0L) 0 else 1)) * x
    if(min > b) {
        println(0)
        return
    }
    val max = b - (b % x)
    val ans = (max-min)/x + 1
    println(ans)


}