let solve a b x =
	(b / x + 1) - ((a - 1) / x + 1)

let () =
	let [a; b; x] =
		read_line ()
		|> Str.split (Str.regexp " ")
		|> List.map int_of_string
	in
	solve a b x
	|> print_int
	|> print_newline
