import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner in = new Scanner(System.in);
    int num = Integer.parseInt(in.nextLine());
    List<Integer> dif = new ArrayList<>();
    while(in.hasNext()){
      dif.add(Integer.parseInt(in.next()));
    }
    Collections.sort(dif);
    int ans = dif.get(num / 2) - dif.get(num / 2 - 1);
    System.out.println(ans);
  }
}
       import java.util.*; util.* java public class Main {
  public static void main(String[] args) {
    Scanner in = new Scanner(System.in);
    int num = Integer.parseInt(in.nextLine());
    List<Integer> dif = new ArrayList<>();
    while(in.hasNext()){
      dif.add(Integer.parseInt(in.next()));
    }
    Collections.sort(dif);
    int ans = dif.get(num / 2) - dif.get(num / 2 - 1);
    System.out.println(ans);
  }
} Main public static void main(String[] args) {
    Scanner in = new Scanner(System.in);
    int num = Integer.parseInt(in.nextLine());
    List<Integer> dif = new ArrayList<>();
    while(in.hasNext()){
      dif.add(Integer.parseInt(in.next()));
    }
    Collections.sort(dif);
    int ans = dif.get(num / 2) - dif.get(num / 2 - 1);
    System.out.println(ans);
  } main {
    Scanner in = new Scanner(System.in);
    int num = Integer.parseInt(in.nextLine());
    List<Integer> dif = new ArrayList<>();
    while(in.hasNext()){
      dif.add(Integer.parseInt(in.next()));
    }
    Collections.sort(dif);
    int ans = dif.get(num / 2) - dif.get(num / 2 - 1);
    System.out.println(ans);
  } Scanner in = new Scanner(System.in); in new Scanner(System.in) int num = Integer.parseInt(in.nextLine()); num Integer.parseInt(in.nextLine()) Integer.parseInt Integer in.nextLine() in.nextLine in List<Integer> dif = new ArrayList<>(); dif new ArrayList<>() while(in.hasNext()){
      dif.add(Integer.parseInt(in.next()));
    } in.hasNext() in.hasNext in {
      dif.add(Integer.parseInt(in.next()));
    } dif.add(Integer.parseInt(in.next())) dif.add dif Integer.parseInt(in.next()) Integer.parseInt Integer in.next() in.next in Collections.sort(dif) Collections.sort Collections dif int ans = dif.get(num / 2) - dif.get(num / 2 - 1); ans dif.get(num / 2) - dif.get(num / 2 - 1) dif.get(num / 2) dif.get dif num / 2 num 2 dif.get(num / 2 - 1) dif.get dif num / 2 - 1 num / 2 num 2 1 System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {
  public static void main(String[] args) {
    Scanner in = new Scanner(System.in);
    int num = Integer.parseInt(in.nextLine());
    List<Integer> dif = new ArrayList<>();
    while(in.hasNext()){
      dif.add(Integer.parseInt(in.next()));
    }
    Collections.sort(dif);
    int ans = dif.get(num / 2) - dif.get(num / 2 - 1);
    System.out.println(ans);
  }
} public class Main {
  public static void main(String[] args) {
    Scanner in = new Scanner(System.in);
    int num = Integer.parseInt(in.nextLine());
    List<Integer> dif = new ArrayList<>();
    while(in.hasNext()){
      dif.add(Integer.parseInt(in.next()));
    }
    Collections.sort(dif);
    int ans = dif.get(num / 2) - dif.get(num / 2 - 1);
    System.out.println(ans);
  }
} Main
import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner in = new Scanner(System.in);
    int num = Integer.parseInt(in.nextLine());
    List<Integer> dif = new ArrayList<>();
    while(in.hasNext()){
      dif.add(Integer.parseInt(in.next()));
    }
    Collections.sort(dif);
    int ans = dif.get(num / 2) - dif.get(num / 2 - 1);
    System.out.println(ans);
  }
}
      