stdin.ReadLine()
|> fun x -> x.Split(' ')
|> Array.map uint64
|> fun x -> (x.[0], x.[1], x.[2])
|> fun (a, b, x) ->
    (
        if a = b then 0UL
        else (b / x) - (a / x) + if (a % x = 0UL) && (b % x = 0UL) then 1UL else 0UL
    )
    |> printfn "%d"
