import java.util.*;

public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int N=sc.nextInt();
		int K;
		int[] P = new int [100100];
		for(int i=0; i<N; i++){
			P[i] = sc.nextInt();
		}
		Arrays.sort(P,0,N);


		K = P[N/2] - P[N/2-1];

		System.out.println(K);
	}
} import java.util.*; util.* java public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int N=sc.nextInt();
		int K;
		int[] P = new int [100100];
		for(int i=0; i<N; i++){
			P[i] = sc.nextInt();
		}
		Arrays.sort(P,0,N);


		K = P[N/2] - P[N/2-1];

		System.out.println(K);
	}
} Main public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int N=sc.nextInt();
		int K;
		int[] P = new int [100100];
		for(int i=0; i<N; i++){
			P[i] = sc.nextInt();
		}
		Arrays.sort(P,0,N);


		K = P[N/2] - P[N/2-1];

		System.out.println(K);
	} main {
		Scanner sc = new Scanner(System.in);
		int N=sc.nextInt();
		int K;
		int[] P = new int [100100];
		for(int i=0; i<N; i++){
			P[i] = sc.nextInt();
		}
		Arrays.sort(P,0,N);


		K = P[N/2] - P[N/2-1];

		System.out.println(K);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N=sc.nextInt(); N sc.nextInt() sc.nextInt sc int K; K int[] P = new int [100100]; P new int [100100] 100100 for(int i=0; i<N; i++){
			P[i] = sc.nextInt();
		} int i=0; int i=0; i 0 i<N i N i++ i++ i {
			P[i] = sc.nextInt();
		} {
			P[i] = sc.nextInt();
		} P[i] = sc.nextInt() P[i] P i sc.nextInt() sc.nextInt sc Arrays.sort(P,0,N) Arrays.sort Arrays P 0 N K = P[N/2] - P[N/2-1] K P[N/2] - P[N/2-1] P[N/2] P N/2 N 2 P[N/2-1] P N/2-1 N/2 N 2 1 System.out.println(K) System.out.println System.out System System.out K String[] args args public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int N=sc.nextInt();
		int K;
		int[] P = new int [100100];
		for(int i=0; i<N; i++){
			P[i] = sc.nextInt();
		}
		Arrays.sort(P,0,N);


		K = P[N/2] - P[N/2-1];

		System.out.println(K);
	}
} public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int N=sc.nextInt();
		int K;
		int[] P = new int [100100];
		for(int i=0; i<N; i++){
			P[i] = sc.nextInt();
		}
		Arrays.sort(P,0,N);


		K = P[N/2] - P[N/2-1];

		System.out.println(K);
	}
} Main
import java.util.*;

public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int N=sc.nextInt();
		int K;
		int[] P = new int [100100];
		for(int i=0; i<N; i++){
			P[i] = sc.nextInt();
		}
		Arrays.sort(P,0,N);


		K = P[N/2] - P[N/2-1];

		System.out.println(K);
	}
}