import java.util.*

fun f(a: Long, x: Long): Long {
    if (a == -1L) {
        return 0
    }
    return a / x + 1
}

fun main(args: Array<String>) {
    val sc = Scanner(System.`in`)
    val a = sc.nextLong()
    val b = sc.nextLong()
    val x = sc.nextLong()
    println(f(b, x) - f(a - 1, x))
}