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