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