fun main(args: Array<String>) {
    abc048b()
}

fun abc048b() {
    val (a, b, x) = readLine()!!.split(" ").map { it.toLong() }

    val answer = (b / x) + 1 - (if (a == 0L) 0 else (a - 1) / x + 1)

    println(answer)
}
