
import java.util.*;


public class Main {
	
	
	public static void main(String[] args) {

		Scanner s = new Scanner(System.in);
		
		int n = s.nextInt();
		int[] a = new int[n+1];
		for(int i = 1;i<=n;i++)a[i] = s.nextInt();
		int c=  0;
		
		Arrays.sort(a,1,n+1);
		
		// 1 4 4 6 7 9
		int l = a[n/2], h = a[n/2+1] ;
		for(int i = a[n/2]-1; i<=a[n/2 +1] ; i++)
		{
			if(l<=i && h > i)c++;
		}
		
		 System.out.println(c);
	}
} import java.util.*; util.* java public class Main {
	
	
	public static void main(String[] args) {

		Scanner s = new Scanner(System.in);
		
		int n = s.nextInt();
		int[] a = new int[n+1];
		for(int i = 1;i<=n;i++)a[i] = s.nextInt();
		int c=  0;
		
		Arrays.sort(a,1,n+1);
		
		// 1 4 4 6 7 9
		int l = a[n/2], h = a[n/2+1] ;
		for(int i = a[n/2]-1; i<=a[n/2 +1] ; i++)
		{
			if(l<=i && h > i)c++;
		}
		
		 System.out.println(c);
	}
} Main public static void main(String[] args) {

		Scanner s = new Scanner(System.in);
		
		int n = s.nextInt();
		int[] a = new int[n+1];
		for(int i = 1;i<=n;i++)a[i] = s.nextInt();
		int c=  0;
		
		Arrays.sort(a,1,n+1);
		
		// 1 4 4 6 7 9
		int l = a[n/2], h = a[n/2+1] ;
		for(int i = a[n/2]-1; i<=a[n/2 +1] ; i++)
		{
			if(l<=i && h > i)c++;
		}
		
		 System.out.println(c);
	} main {

		Scanner s = new Scanner(System.in);
		
		int n = s.nextInt();
		int[] a = new int[n+1];
		for(int i = 1;i<=n;i++)a[i] = s.nextInt();
		int c=  0;
		
		Arrays.sort(a,1,n+1);
		
		// 1 4 4 6 7 9
		int l = a[n/2], h = a[n/2+1] ;
		for(int i = a[n/2]-1; i<=a[n/2 +1] ; i++)
		{
			if(l<=i && h > i)c++;
		}
		
		 System.out.println(c);
	} Scanner s = new Scanner(System.in); s new Scanner(System.in) int n = s.nextInt(); n s.nextInt() s.nextInt s int[] a = new int[n+1]; a new int[n+1] n+1 n 1 for(int i = 1;i<=n;i++)a[i] = s.nextInt(); int i = 1; int i = 1; i 1 i<=n i n i++ i++ i a[i] = s.nextInt(); a[i] = s.nextInt() a[i] a i s.nextInt() s.nextInt s int c=  0; c 0 Arrays.sort(a,1,n+1) Arrays.sort Arrays a 1 n+1 n 1 int l = a[n/2] l a[n/2] a n/2 n 2 h = a[n/2+1] ; h a[n/2+1] a n/2+1 n/2 n 2 1 for(int i = a[n/2]-1; i<=a[n/2 +1] ; i++)
		{
			if(l<=i && h > i)c++;
		} int i = a[n/2]-1; int i = a[n/2]-1; i a[n/2]-1 a[n/2] a n/2 n 2 1 i<=a[n/2 +1] i a[n/2 +1] a n/2 +1 n/2 n 2 1 i++ i++ i {
			if(l<=i && h > i)c++;
		} {
			if(l<=i && h > i)c++;
		} if(l<=i && h > i)c++; l<=i && h > i l<=i l i h > i h i c++ c System.out.println(c) System.out.println System.out System System.out c String[] args args public class Main {
	
	
	public static void main(String[] args) {

		Scanner s = new Scanner(System.in);
		
		int n = s.nextInt();
		int[] a = new int[n+1];
		for(int i = 1;i<=n;i++)a[i] = s.nextInt();
		int c=  0;
		
		Arrays.sort(a,1,n+1);
		
		// 1 4 4 6 7 9
		int l = a[n/2], h = a[n/2+1] ;
		for(int i = a[n/2]-1; i<=a[n/2 +1] ; i++)
		{
			if(l<=i && h > i)c++;
		}
		
		 System.out.println(c);
	}
} public class Main {
	
	
	public static void main(String[] args) {

		Scanner s = new Scanner(System.in);
		
		int n = s.nextInt();
		int[] a = new int[n+1];
		for(int i = 1;i<=n;i++)a[i] = s.nextInt();
		int c=  0;
		
		Arrays.sort(a,1,n+1);
		
		// 1 4 4 6 7 9
		int l = a[n/2], h = a[n/2+1] ;
		for(int i = a[n/2]-1; i<=a[n/2 +1] ; i++)
		{
			if(l<=i && h > i)c++;
		}
		
		 System.out.println(c);
	}
} Main

import java.util.*;


public class Main {
	
	
	public static void main(String[] args) {

		Scanner s = new Scanner(System.in);
		
		int n = s.nextInt();
		int[] a = new int[n+1];
		for(int i = 1;i<=n;i++)a[i] = s.nextInt();
		int c=  0;
		
		Arrays.sort(a,1,n+1);
		
		// 1 4 4 6 7 9
		int l = a[n/2], h = a[n/2+1] ;
		for(int i = a[n/2]-1; i<=a[n/2 +1] ; i++)
		{
			if(l<=i && h > i)c++;
		}
		
		 System.out.println(c);
	}
}
