Module Module1

    Sub Main()
        Dim sInput1 As String()
        Dim sInput2 As String()
        sInput1 = Console.ReadLine().Split(" ")
        sInput2 = Console.ReadLine().Split(" ")
        Console.WriteLine(CType(sInput2.Max(), Integer) - CType(sInput2.Min(), Integer))
        Console.ReadLine()
    End Sub

End Module
