import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();

		int tmp;
		ArrayList<Integer> d = new ArrayList<Integer>();
		for(int i=0; i<N; i++) {
			tmp = sc.nextInt();
			d.add(tmp);
		}

		Collections.sort(d);

		int m = d.size()/2;
		int ans = d.get(m)-d.get(m-1);

		if(ans >= 1)System.out.println(ans);
		else System.out.println(0);
	}
} import java.util.ArrayList; ArrayList java.util import java.util.Collections; Collections java.util import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();

		int tmp;
		ArrayList<Integer> d = new ArrayList<Integer>();
		for(int i=0; i<N; i++) {
			tmp = sc.nextInt();
			d.add(tmp);
		}

		Collections.sort(d);

		int m = d.size()/2;
		int ans = d.get(m)-d.get(m-1);

		if(ans >= 1)System.out.println(ans);
		else System.out.println(0);
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();

		int tmp;
		ArrayList<Integer> d = new ArrayList<Integer>();
		for(int i=0; i<N; i++) {
			tmp = sc.nextInt();
			d.add(tmp);
		}

		Collections.sort(d);

		int m = d.size()/2;
		int ans = d.get(m)-d.get(m-1);

		if(ans >= 1)System.out.println(ans);
		else System.out.println(0);
	} main {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();

		int tmp;
		ArrayList<Integer> d = new ArrayList<Integer>();
		for(int i=0; i<N; i++) {
			tmp = sc.nextInt();
			d.add(tmp);
		}

		Collections.sort(d);

		int m = d.size()/2;
		int ans = d.get(m)-d.get(m-1);

		if(ans >= 1)System.out.println(ans);
		else System.out.println(0);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc int tmp; tmp ArrayList<Integer> d = new ArrayList<Integer>(); d new ArrayList<Integer>() for(int i=0; i<N; i++) {
			tmp = sc.nextInt();
			d.add(tmp);
		} int i=0; int i=0; i 0 i<N i N i++ i++ i {
			tmp = sc.nextInt();
			d.add(tmp);
		} {
			tmp = sc.nextInt();
			d.add(tmp);
		} tmp = sc.nextInt() tmp sc.nextInt() sc.nextInt sc d.add(tmp) d.add d tmp Collections.sort(d) Collections.sort Collections d int m = d.size()/2; m d.size()/2 d.size() d.size d 2 int ans = d.get(m)-d.get(m-1); ans d.get(m)-d.get(m-1) d.get(m) d.get d m d.get(m-1) d.get d m-1 m 1 if(ans >= 1)System.out.println(ans);
		else System.out.println(0); ans >= 1 ans 1 System.out.println(ans) System.out.println System.out System System.out ans System.out.println(0) System.out.println System.out System System.out 0 String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();

		int tmp;
		ArrayList<Integer> d = new ArrayList<Integer>();
		for(int i=0; i<N; i++) {
			tmp = sc.nextInt();
			d.add(tmp);
		}

		Collections.sort(d);

		int m = d.size()/2;
		int ans = d.get(m)-d.get(m-1);

		if(ans >= 1)System.out.println(ans);
		else System.out.println(0);
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();

		int tmp;
		ArrayList<Integer> d = new ArrayList<Integer>();
		for(int i=0; i<N; i++) {
			tmp = sc.nextInt();
			d.add(tmp);
		}

		Collections.sort(d);

		int m = d.size()/2;
		int ans = d.get(m)-d.get(m-1);

		if(ans >= 1)System.out.println(ans);
		else System.out.println(0);
	}
} Main
import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();

		int tmp;
		ArrayList<Integer> d = new ArrayList<Integer>();
		for(int i=0; i<N; i++) {
			tmp = sc.nextInt();
			d.add(tmp);
		}

		Collections.sort(d);

		int m = d.size()/2;
		int ans = d.get(m)-d.get(m-1);

		if(ans >= 1)System.out.println(ans);
		else System.out.println(0);
	}
}
