import java.util.*;
 
public class Main {
	public static void main (String[] args) {
		Scanner in = new Scanner(System.in);
		
		int n = in.nextInt();
        int nam[] = new int[n];
      
      for(int i = 0 ;i < n ;i++){
       nam[i] =  in.nextInt();
      }
      Arrays.sort(nam);
     
      if(nam[(n/2)-1]==nam[n/2]){System.out.print(0);}
      else{System.out.print(nam[n/2]-nam[(n/2)-1]);}
      
      
      
	}
} import java.util.*; util.* java public class Main {
	public static void main (String[] args) {
		Scanner in = new Scanner(System.in);
		
		int n = in.nextInt();
        int nam[] = new int[n];
      
      for(int i = 0 ;i < n ;i++){
       nam[i] =  in.nextInt();
      }
      Arrays.sort(nam);
     
      if(nam[(n/2)-1]==nam[n/2]){System.out.print(0);}
      else{System.out.print(nam[n/2]-nam[(n/2)-1]);}
      
      
      
	}
} Main public static void main (String[] args) {
		Scanner in = new Scanner(System.in);
		
		int n = in.nextInt();
        int nam[] = new int[n];
      
      for(int i = 0 ;i < n ;i++){
       nam[i] =  in.nextInt();
      }
      Arrays.sort(nam);
     
      if(nam[(n/2)-1]==nam[n/2]){System.out.print(0);}
      else{System.out.print(nam[n/2]-nam[(n/2)-1]);}
      
      
      
	} main {
		Scanner in = new Scanner(System.in);
		
		int n = in.nextInt();
        int nam[] = new int[n];
      
      for(int i = 0 ;i < n ;i++){
       nam[i] =  in.nextInt();
      }
      Arrays.sort(nam);
     
      if(nam[(n/2)-1]==nam[n/2]){System.out.print(0);}
      else{System.out.print(nam[n/2]-nam[(n/2)-1]);}
      
      
      
	} Scanner in = new Scanner(System.in); in new Scanner(System.in) int n = in.nextInt(); n in.nextInt() in.nextInt in int nam[] = new int[n]; nam new int[n] n for(int i = 0 ;i < n ;i++){
       nam[i] =  in.nextInt();
      } int i = 0 ; int i = 0 ; i 0 i < n i n i++ i++ i {
       nam[i] =  in.nextInt();
      } {
       nam[i] =  in.nextInt();
      } nam[i] =  in.nextInt() nam[i] nam i in.nextInt() in.nextInt in Arrays.sort(nam) Arrays.sort Arrays nam if(nam[(n/2)-1]==nam[n/2]){System.out.print(0);}
      else{System.out.print(nam[n/2]-nam[(n/2)-1]);} nam[(n/2)-1]==nam[n/2] nam[(n/2)-1] nam (n/2)-1 (n/2) n 2 1 nam[n/2] nam n/2 n 2 {System.out.print(0);} System.out.print(0) System.out.print System.out System System.out 0 {System.out.print(nam[n/2]-nam[(n/2)-1]);} System.out.print(nam[n/2]-nam[(n/2)-1]) System.out.print System.out System System.out nam[n/2]-nam[(n/2)-1] nam[n/2] nam n/2 n 2 nam[(n/2)-1] nam (n/2)-1 (n/2) n 2 1 String[] args args public class Main {
	public static void main (String[] args) {
		Scanner in = new Scanner(System.in);
		
		int n = in.nextInt();
        int nam[] = new int[n];
      
      for(int i = 0 ;i < n ;i++){
       nam[i] =  in.nextInt();
      }
      Arrays.sort(nam);
     
      if(nam[(n/2)-1]==nam[n/2]){System.out.print(0);}
      else{System.out.print(nam[n/2]-nam[(n/2)-1]);}
      
      
      
	}
} public class Main {
	public static void main (String[] args) {
		Scanner in = new Scanner(System.in);
		
		int n = in.nextInt();
        int nam[] = new int[n];
      
      for(int i = 0 ;i < n ;i++){
       nam[i] =  in.nextInt();
      }
      Arrays.sort(nam);
     
      if(nam[(n/2)-1]==nam[n/2]){System.out.print(0);}
      else{System.out.print(nam[n/2]-nam[(n/2)-1]);}
      
      
      
	}
} Main
import java.util.*;
 
public class Main {
	public static void main (String[] args) {
		Scanner in = new Scanner(System.in);
		
		int n = in.nextInt();
        int nam[] = new int[n];
      
      for(int i = 0 ;i < n ;i++){
       nam[i] =  in.nextInt();
      }
      Arrays.sort(nam);
     
      if(nam[(n/2)-1]==nam[n/2]){System.out.print(0);}
      else{System.out.print(nam[n/2]-nam[(n/2)-1]);}
      
      
      
	}
}