import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
    	
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		int N = sc.nextInt();
		
		int ans = 0;
		ArrayList<Integer> intList = new ArrayList<Integer>();

		for (int i = 0; i < N;i ++ ){
			intList.add(sc.nextInt());
		}
		 
		 Collections.sort(intList);
		 
		int tyukan = N / 2;
		if(intList.get(tyukan - 1)==intList.get(tyukan)){
		}else{
			ans = intList.get(tyukan) - intList.get(tyukan - 1); 
		}

		System.out.println(ans);

   		sc.close();
        return ;

    }
    
}
 import java.util.ArrayList; ArrayList java.util import java.util.Arrays; Arrays java.util import java.util.Collections; Collections java.util import java.util.HashMap; HashMap java.util import java.util.Map; Map 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 ans = 0;
		ArrayList<Integer> intList = new ArrayList<Integer>();

		for (int i = 0; i < N;i ++ ){
			intList.add(sc.nextInt());
		}
		 
		 Collections.sort(intList);
		 
		int tyukan = N / 2;
		if(intList.get(tyukan - 1)==intList.get(tyukan)){
		}else{
			ans = intList.get(tyukan) - intList.get(tyukan - 1); 
		}

		System.out.println(ans);

   		sc.close();
        return ;

    }
    
} Main public static void main(String[] args) {
    	
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		int N = sc.nextInt();
		
		int ans = 0;
		ArrayList<Integer> intList = new ArrayList<Integer>();

		for (int i = 0; i < N;i ++ ){
			intList.add(sc.nextInt());
		}
		 
		 Collections.sort(intList);
		 
		int tyukan = N / 2;
		if(intList.get(tyukan - 1)==intList.get(tyukan)){
		}else{
			ans = intList.get(tyukan) - intList.get(tyukan - 1); 
		}

		System.out.println(ans);

   		sc.close();
        return ;

    } main {
    	
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		int N = sc.nextInt();
		
		int ans = 0;
		ArrayList<Integer> intList = new ArrayList<Integer>();

		for (int i = 0; i < N;i ++ ){
			intList.add(sc.nextInt());
		}
		 
		 Collections.sort(intList);
		 
		int tyukan = N / 2;
		if(intList.get(tyukan - 1)==intList.get(tyukan)){
		}else{
			ans = intList.get(tyukan) - intList.get(tyukan - 1); 
		}

		System.out.println(ans);

   		sc.close();
        return ;

    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc int ans = 0; ans 0 ArrayList<Integer> intList = new ArrayList<Integer>(); intList new ArrayList<Integer>() for (int i = 0; i < N;i ++ ){
			intList.add(sc.nextInt());
		} int i = 0; int i = 0; i 0 i < N i N i ++ i ++ i {
			intList.add(sc.nextInt());
		} {
			intList.add(sc.nextInt());
		} intList.add(sc.nextInt()) intList.add intList sc.nextInt() sc.nextInt sc Collections.sort(intList) Collections.sort Collections intList int tyukan = N / 2; tyukan N / 2 N 2 if(intList.get(tyukan - 1)==intList.get(tyukan)){
		}else{
			ans = intList.get(tyukan) - intList.get(tyukan - 1); 
		} intList.get(tyukan - 1)==intList.get(tyukan) intList.get(tyukan - 1) intList.get intList tyukan - 1 tyukan 1 intList.get(tyukan) intList.get intList tyukan {
		} {
			ans = intList.get(tyukan) - intList.get(tyukan - 1); 
		} ans = intList.get(tyukan) - intList.get(tyukan - 1) ans intList.get(tyukan) - intList.get(tyukan - 1) intList.get(tyukan) intList.get intList tyukan intList.get(tyukan - 1) intList.get intList tyukan - 1 tyukan 1 System.out.println(ans) System.out.println System.out System System.out ans sc.close() sc.close sc return ; String[] args args public class Main {

    public static void main(String[] args) {
    	
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		int N = sc.nextInt();
		
		int ans = 0;
		ArrayList<Integer> intList = new ArrayList<Integer>();

		for (int i = 0; i < N;i ++ ){
			intList.add(sc.nextInt());
		}
		 
		 Collections.sort(intList);
		 
		int tyukan = N / 2;
		if(intList.get(tyukan - 1)==intList.get(tyukan)){
		}else{
			ans = intList.get(tyukan) - intList.get(tyukan - 1); 
		}

		System.out.println(ans);

   		sc.close();
        return ;

    }
    
} public class Main {

    public static void main(String[] args) {
    	
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		int N = sc.nextInt();
		
		int ans = 0;
		ArrayList<Integer> intList = new ArrayList<Integer>();

		for (int i = 0; i < N;i ++ ){
			intList.add(sc.nextInt());
		}
		 
		 Collections.sort(intList);
		 
		int tyukan = N / 2;
		if(intList.get(tyukan - 1)==intList.get(tyukan)){
		}else{
			ans = intList.get(tyukan) - intList.get(tyukan - 1); 
		}

		System.out.println(ans);

   		sc.close();
        return ;

    }
    
} Main
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
    	
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		int N = sc.nextInt();
		
		int ans = 0;
		ArrayList<Integer> intList = new ArrayList<Integer>();

		for (int i = 0; i < N;i ++ ){
			intList.add(sc.nextInt());
		}
		 
		 Collections.sort(intList);
		 
		int tyukan = N / 2;
		if(intList.get(tyukan - 1)==intList.get(tyukan)){
		}else{
			ans = intList.get(tyukan) - intList.get(tyukan - 1); 
		}

		System.out.println(ans);

   		sc.close();
        return ;

    }
    
}

