function Main(inp) {
    var input = inp.split('\n')[0].split(' ').map(function(n) {
        return Number(n);
    });
    var a = input[0];
    var b = input[1];
    var x = input[2];
    var forA = (a > 1) ? Math.floor((a - 1)/ x) + 1 : 0;
    var forB = Math.floor(b / x) + 1;
    console.log(forB - forA);
}

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