import java.util.*;

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

public class Main {
	
	public static void main(String[] args)  {
		Scanner scan = new Scanner(System.in);
		int n=Integer.parseInt(scan.next());
		int[] d=new int[n];
		for (int i=0;i<n;++i) {
			d[i]=Integer.parseInt(scan.next());
		}
		Arrays.parallelSort(d);
		if (d[n/2]==d[n/2-1]) {
			System.out.print(0);
		}else {
			System.out.print(d[n/2]-d[n/2-1]);
		}
		
}
}
//end