import Data.List

main= do
 n_by2 <- (`div`2).(read::String->Int)<$> getLine
 sorted <-  sort.map (read::String->Int).words<$> getLine
 --let group = groupBy(==) sorted
 if sorted!!(n_by2-1)  == sorted!!(n_by2) then print 0 
 else print $  sorted!!(n_by2) - sorted!!(n_by2-1)