public class compiler
  Shared Sub Main()
    Dim n As Integer = CType(Console.ReadLine(), Integer)
    Dim input As String = Console.ReadLine()
    Dim d As String()  = input.split(" ")
    Dim dInt(0 To n - 1) As Integer
    For i As Integer = 0 To n - 1
        dInt(i) = CType(d(i), Integer)
    Next
    Array.Sort(dInt)
    Dim output As Integer = dInt(n / 2) - dInt(n / 2 - 1)
    Console.WriteLine(output.ToString())
  End Sub
end class