Module Module1

    'Dim sInput As String
    'sInput = Console.ReadLine()
    'If sInput(2) = sInput(3) And sInput(4) = sInput(5) Then
    '    Console.WriteLine("Yes")
    'Else
    '    Console.WriteLine("No")
    'End If

    'Dim sInput As Integer
    '    sInput = Console.ReadLine()
    '    Dim sExpect1000 As Integer = sInput \ 500
    'Dim sExpect5 As Integer = (sInput Mod 500) \ 5
    '    Console.WriteLine(sExpect1000 * 1000 + sExpect5 * 5)
    '    Console.ReadLine()

    Sub Main()
        Dim sInput1 As String()
        Dim sInput2 As String()
        sInput1 = Console.ReadLine().Split(" ")
        sInput2 = Console.ReadLine().Split(" ")
        'Console.WriteLine(CType(sInput2.Last, Integer) - CType(sInput2.First, Integer))
        Console.WriteLine(sInput2.Last())

    End Sub

End Module
