import java.util.*;
public class Main{
	public static void main(String arg[]){
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		int a[]=new int[n];
		for(int i=0;i<n;i++)
			a[i]=sc.nextInt();
		Arrays.sort(a);
		int m=a.length/2;
		if(a[m]==a[m-1])
			System.out.println("0");
		else{
			if(a[m-1]!=a[m])
				System.out.println(a[m]-a[m-1]);
		}
	}
} import java.util.*; util.* java public class Main{
	public static void main(String arg[]){
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		int a[]=new int[n];
		for(int i=0;i<n;i++)
			a[i]=sc.nextInt();
		Arrays.sort(a);
		int m=a.length/2;
		if(a[m]==a[m-1])
			System.out.println("0");
		else{
			if(a[m-1]!=a[m])
				System.out.println(a[m]-a[m-1]);
		}
	}
} Main public static void main(String arg[]){
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		int a[]=new int[n];
		for(int i=0;i<n;i++)
			a[i]=sc.nextInt();
		Arrays.sort(a);
		int m=a.length/2;
		if(a[m]==a[m-1])
			System.out.println("0");
		else{
			if(a[m-1]!=a[m])
				System.out.println(a[m]-a[m-1]);
		}
	} main {
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		int a[]=new int[n];
		for(int i=0;i<n;i++)
			a[i]=sc.nextInt();
		Arrays.sort(a);
		int m=a.length/2;
		if(a[m]==a[m-1])
			System.out.println("0");
		else{
			if(a[m-1]!=a[m])
				System.out.println(a[m]-a[m-1]);
		}
	} Scanner sc=new Scanner(System.in); sc new Scanner(System.in) int n=sc.nextInt(); n sc.nextInt() sc.nextInt sc int a[]=new int[n]; a new int[n] n for(int i=0;i<n;i++)
			a[i]=sc.nextInt(); int i=0; int i=0; i 0 i<n i n i++ i++ i a[i]=sc.nextInt(); a[i]=sc.nextInt() a[i] a i sc.nextInt() sc.nextInt sc Arrays.sort(a) Arrays.sort Arrays a int m=a.length/2; m a.length/2 a.length a a.length 2 if(a[m]==a[m-1])
			System.out.println("0");
		else{
			if(a[m-1]!=a[m])
				System.out.println(a[m]-a[m-1]);
		} a[m]==a[m-1] a[m] a m a[m-1] a m-1 m 1 System.out.println("0") System.out.println System.out System System.out "0" {
			if(a[m-1]!=a[m])
				System.out.println(a[m]-a[m-1]);
		} if(a[m-1]!=a[m])
				System.out.println(a[m]-a[m-1]); a[m-1]!=a[m] a[m-1] a m-1 m 1 a[m] a m System.out.println(a[m]-a[m-1]) System.out.println System.out System System.out a[m]-a[m-1] a[m] a m a[m-1] a m-1 m 1 String arg[] arg public class Main{
	public static void main(String arg[]){
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		int a[]=new int[n];
		for(int i=0;i<n;i++)
			a[i]=sc.nextInt();
		Arrays.sort(a);
		int m=a.length/2;
		if(a[m]==a[m-1])
			System.out.println("0");
		else{
			if(a[m-1]!=a[m])
				System.out.println(a[m]-a[m-1]);
		}
	}
} public class Main{
	public static void main(String arg[]){
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		int a[]=new int[n];
		for(int i=0;i<n;i++)
			a[i]=sc.nextInt();
		Arrays.sort(a);
		int m=a.length/2;
		if(a[m]==a[m-1])
			System.out.println("0");
		else{
			if(a[m-1]!=a[m])
				System.out.println(a[m]-a[m-1]);
		}
	}
} Main
import java.util.*;
public class Main{
	public static void main(String arg[]){
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		int a[]=new int[n];
		for(int i=0;i<n;i++)
			a[i]=sc.nextInt();
		Arrays.sort(a);
		int m=a.length/2;
		if(a[m]==a[m-1])
			System.out.println("0");
		else{
			if(a[m-1]!=a[m])
				System.out.println(a[m]-a[m-1]);
		}
	}
}