import java.util.*;

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

      int n = sc.nextInt();
      int half=n/2;
      int cnt=0;

      int[] d = new int[n];

      for(int i=0;i<n;i++){
        d[i] = sc.nextInt();
      }

      Arrays.sort(d);

      for(int i=d[half-1]+1;i<=d[half];i++){
        cnt++;
      }


      System.out.println(cnt);

    }
} 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 half=n/2;
      int cnt=0;

      int[] d = new int[n];

      for(int i=0;i<n;i++){
        d[i] = sc.nextInt();
      }

      Arrays.sort(d);

      for(int i=d[half-1]+1;i<=d[half];i++){
        cnt++;
      }


      System.out.println(cnt);

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

      int n = sc.nextInt();
      int half=n/2;
      int cnt=0;

      int[] d = new int[n];

      for(int i=0;i<n;i++){
        d[i] = sc.nextInt();
      }

      Arrays.sort(d);

      for(int i=d[half-1]+1;i<=d[half];i++){
        cnt++;
      }


      System.out.println(cnt);

    } main {
      Scanner sc = new Scanner(System.in);

      int n = sc.nextInt();
      int half=n/2;
      int cnt=0;

      int[] d = new int[n];

      for(int i=0;i<n;i++){
        d[i] = sc.nextInt();
      }

      Arrays.sort(d);

      for(int i=d[half-1]+1;i<=d[half];i++){
        cnt++;
      }


      System.out.println(cnt);

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

      int n = sc.nextInt();
      int half=n/2;
      int cnt=0;

      int[] d = new int[n];

      for(int i=0;i<n;i++){
        d[i] = sc.nextInt();
      }

      Arrays.sort(d);

      for(int i=d[half-1]+1;i<=d[half];i++){
        cnt++;
      }


      System.out.println(cnt);

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

      int n = sc.nextInt();
      int half=n/2;
      int cnt=0;

      int[] d = new int[n];

      for(int i=0;i<n;i++){
        d[i] = sc.nextInt();
      }

      Arrays.sort(d);

      for(int i=d[half-1]+1;i<=d[half];i++){
        cnt++;
      }


      System.out.println(cnt);

    }
} Main
import java.util.*;

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

      int n = sc.nextInt();
      int half=n/2;
      int cnt=0;

      int[] d = new int[n];

      for(int i=0;i<n;i++){
        d[i] = sc.nextInt();
      }

      Arrays.sort(d);

      for(int i=d[half-1]+1;i<=d[half];i++){
        cnt++;
      }


      System.out.println(cnt);

    }
}
