Option Strict On
Imports System.Collections.Generic
Imports System.Console

Module Program
    Sub Main()
        Dim a As Long = NextLong()
        Dim b As Long = NextLong()
        Dim x As Long = NextLong()

        Dim ans As Long = b \ x

        If a <> 0 Then
            ans += 1
        Else
            ans -= (a - 1) \ x
        End If

        WriteLine(ans)
    End Sub

    Function NextLong() As Long
        Return CLng(NextString())
    End Function

    Function NextString() As String
        Dim result As New List(Of Char)
        Do
            Dim tmp As Integer = Read()
            If tmp < 0 Then Exit Do
            Dim nextChar As Char = Chr(tmp)

            If Not Char.IsWhiteSpace(nextChar) Then
                result.Add(nextChar)
            ElseIf nextChar <> vbCr Then
                Exit Do
            End If
        Loop
        Return New String(result.ToArray())
    End Function

End Module
