<?php

fscanf(STDIN,"%d %d %d",$a,$b,$x);
$a_mod_x = $a % $x;
$left = $a;

if($a_mod_x != 0) {
	$left = $a - $a_mod_x + $x;
}

$right = $b - $b % $x;
$answer = ($right - $left) / $x + 1;

echo $answer, "\n";

?>