'use strict'

function main(input) {
  const inputList = input.split(' ');
  const a = Number(inputList[0])
  const b = Number(inputList[1])
  const x = Number(inputList[2])

  let count = 0
  const max = Math.floor(b/x)
  const min = Math.ceil(a/x)

  console.log(max - min + 1)
}

main(require("fs").readFileSync("/dev/stdin", "utf8"));