function Main(input) {
  input = input.split("\n");
  var n = input[0].split(" ");
  var a = parseInt(n[0]);
  var b = parseInt(n[1]);
  var x = parseInt(n[2]);
  var max = 0;
  var min =0;
  var ans=0;
    ans=Math.floor(b/x)-Math.floor((a-1)/x);

  console.log('%s', ans);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));