
import java.util.Arrays;
import java.util.Scanner;

/**
 * @author yoshizaki
 * ABC 132
 */
public class Main {
    public static void main(String[] args) {
        Scanner scanner= new Scanner(System.in);
        int problems = scanner.nextInt();
        int[] difficults = new int[problems];
        for (int i = 0; i < problems; i++) {
            difficults[i] = scanner.nextInt();
        }
        Arrays.sort(difficults);
        int under = difficults[(problems / 2) -1];
        int over = difficults[problems / 2];
        int answer = over -under;
        
        System.out.println(answer);
    }
} import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner scanner= new Scanner(System.in);
        int problems = scanner.nextInt();
        int[] difficults = new int[problems];
        for (int i = 0; i < problems; i++) {
            difficults[i] = scanner.nextInt();
        }
        Arrays.sort(difficults);
        int under = difficults[(problems / 2) -1];
        int over = difficults[problems / 2];
        int answer = over -under;
        
        System.out.println(answer);
    }
} Main public static void main(String[] args) {
        Scanner scanner= new Scanner(System.in);
        int problems = scanner.nextInt();
        int[] difficults = new int[problems];
        for (int i = 0; i < problems; i++) {
            difficults[i] = scanner.nextInt();
        }
        Arrays.sort(difficults);
        int under = difficults[(problems / 2) -1];
        int over = difficults[problems / 2];
        int answer = over -under;
        
        System.out.println(answer);
    } main {
        Scanner scanner= new Scanner(System.in);
        int problems = scanner.nextInt();
        int[] difficults = new int[problems];
        for (int i = 0; i < problems; i++) {
            difficults[i] = scanner.nextInt();
        }
        Arrays.sort(difficults);
        int under = difficults[(problems / 2) -1];
        int over = difficults[problems / 2];
        int answer = over -under;
        
        System.out.println(answer);
    } Scanner scanner= new Scanner(System.in); scanner new Scanner(System.in) int problems = scanner.nextInt(); problems scanner.nextInt() scanner.nextInt scanner int[] difficults = new int[problems]; difficults new int[problems] problems for (int i = 0; i < problems; i++) {
            difficults[i] = scanner.nextInt();
        } int i = 0; int i = 0; i 0 i < problems i problems i++ i++ i {
            difficults[i] = scanner.nextInt();
        } {
            difficults[i] = scanner.nextInt();
        } difficults[i] = scanner.nextInt() difficults[i] difficults i scanner.nextInt() scanner.nextInt scanner Arrays.sort(difficults) Arrays.sort Arrays difficults int under = difficults[(problems / 2) -1]; under difficults[(problems / 2) -1] difficults (problems / 2) -1 (problems / 2) problems 2 1 int over = difficults[problems / 2]; over difficults[problems / 2] difficults problems / 2 problems 2 int answer = over -under; answer over -under over under System.out.println(answer) System.out.println System.out System System.out answer String[] args args public class Main {
    public static void main(String[] args) {
        Scanner scanner= new Scanner(System.in);
        int problems = scanner.nextInt();
        int[] difficults = new int[problems];
        for (int i = 0; i < problems; i++) {
            difficults[i] = scanner.nextInt();
        }
        Arrays.sort(difficults);
        int under = difficults[(problems / 2) -1];
        int over = difficults[problems / 2];
        int answer = over -under;
        
        System.out.println(answer);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner scanner= new Scanner(System.in);
        int problems = scanner.nextInt();
        int[] difficults = new int[problems];
        for (int i = 0; i < problems; i++) {
            difficults[i] = scanner.nextInt();
        }
        Arrays.sort(difficults);
        int under = difficults[(problems / 2) -1];
        int over = difficults[problems / 2];
        int answer = over -under;
        
        System.out.println(answer);
    }
} Main

import java.util.Arrays;
import java.util.Scanner;

/**
 * @author yoshizaki
 * ABC 132
 */
public class Main {
    public static void main(String[] args) {
        Scanner scanner= new Scanner(System.in);
        int problems = scanner.nextInt();
        int[] difficults = new int[problems];
        for (int i = 0; i < problems; i++) {
            difficults[i] = scanner.nextInt();
        }
        Arrays.sort(difficults);
        int under = difficults[(problems / 2) -1];
        int over = difficults[problems / 2];
        int answer = over -under;
        
        System.out.println(answer);
    }
}
