import java.util.*;
public class Main{
	public static void main(String[] args){
    	Scanner sc = new Scanner(System.in);
      int n = sc.nextInt();
      int m = sc.nextInt();
      int x = sc.nextInt();
      int[] a = new int[m];
      for(int i = 0;i < m;i++)a[i] = sc.nextInt();
      int sum1 = 0;
      int sum2 = 0;
      int x1 = x;
      int x2 = x;
      for(int i = 0;i<m;i++){
      	if(a[i]<x)sum1++;
      }
      for(int i = 0;i < m;i++){
      	if(x<a[i])sum2++;
      }
      System.out.println(Math.min(sum1,sum2));
    }
} 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 m = sc.nextInt();
      int x = sc.nextInt();
      int[] a = new int[m];
      for(int i = 0;i < m;i++)a[i] = sc.nextInt();
      int sum1 = 0;
      int sum2 = 0;
      int x1 = x;
      int x2 = x;
      for(int i = 0;i<m;i++){
      	if(a[i]<x)sum1++;
      }
      for(int i = 0;i < m;i++){
      	if(x<a[i])sum2++;
      }
      System.out.println(Math.min(sum1,sum2));
    }
} Main public static void main(String[] args){
    	Scanner sc = new Scanner(System.in);
      int n = sc.nextInt();
      int m = sc.nextInt();
      int x = sc.nextInt();
      int[] a = new int[m];
      for(int i = 0;i < m;i++)a[i] = sc.nextInt();
      int sum1 = 0;
      int sum2 = 0;
      int x1 = x;
      int x2 = x;
      for(int i = 0;i<m;i++){
      	if(a[i]<x)sum1++;
      }
      for(int i = 0;i < m;i++){
      	if(x<a[i])sum2++;
      }
      System.out.println(Math.min(sum1,sum2));
    } main {
    	Scanner sc = new Scanner(System.in);
      int n = sc.nextInt();
      int m = sc.nextInt();
      int x = sc.nextInt();
      int[] a = new int[m];
      for(int i = 0;i < m;i++)a[i] = sc.nextInt();
      int sum1 = 0;
      int sum2 = 0;
      int x1 = x;
      int x2 = x;
      for(int i = 0;i<m;i++){
      	if(a[i]<x)sum1++;
      }
      for(int i = 0;i < m;i++){
      	if(x<a[i])sum2++;
      }
      System.out.println(Math.min(sum1,sum2));
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int m = sc.nextInt(); m sc.nextInt() sc.nextInt sc int x = sc.nextInt(); x sc.nextInt() sc.nextInt sc int[] a = new int[m]; a new int[m] m for(int i = 0;i < m;i++)a[i] = sc.nextInt(); int i = 0; int i = 0; i 0 i < m i m i++ i++ i a[i] = sc.nextInt(); a[i] = sc.nextInt() a[i] a i sc.nextInt() sc.nextInt sc int sum1 = 0; sum1 0 int sum2 = 0; sum2 0 int x1 = x; x1 x int x2 = x; x2 x for(int i = 0;i<m;i++){
      	if(a[i]<x)sum1++;
      } int i = 0; int i = 0; i 0 i<m i m i++ i++ i {
      	if(a[i]<x)sum1++;
      } {
      	if(a[i]<x)sum1++;
      } if(a[i]<x)sum1++; a[i]<x a[i] a i x sum1++ sum1 for(int i = 0;i < m;i++){
      	if(x<a[i])sum2++;
      } int i = 0; int i = 0; i 0 i < m i m i++ i++ i {
      	if(x<a[i])sum2++;
      } {
      	if(x<a[i])sum2++;
      } if(x<a[i])sum2++; x<a[i] x a[i] a i sum2++ sum2 System.out.println(Math.min(sum1,sum2)) System.out.println System.out System System.out Math.min(sum1,sum2) Math.min Math sum1 sum2 String[] args args public class Main{
	public static void main(String[] args){
    	Scanner sc = new Scanner(System.in);
      int n = sc.nextInt();
      int m = sc.nextInt();
      int x = sc.nextInt();
      int[] a = new int[m];
      for(int i = 0;i < m;i++)a[i] = sc.nextInt();
      int sum1 = 0;
      int sum2 = 0;
      int x1 = x;
      int x2 = x;
      for(int i = 0;i<m;i++){
      	if(a[i]<x)sum1++;
      }
      for(int i = 0;i < m;i++){
      	if(x<a[i])sum2++;
      }
      System.out.println(Math.min(sum1,sum2));
    }
} public class Main{
	public static void main(String[] args){
    	Scanner sc = new Scanner(System.in);
      int n = sc.nextInt();
      int m = sc.nextInt();
      int x = sc.nextInt();
      int[] a = new int[m];
      for(int i = 0;i < m;i++)a[i] = sc.nextInt();
      int sum1 = 0;
      int sum2 = 0;
      int x1 = x;
      int x2 = x;
      for(int i = 0;i<m;i++){
      	if(a[i]<x)sum1++;
      }
      for(int i = 0;i < m;i++){
      	if(x<a[i])sum2++;
      }
      System.out.println(Math.min(sum1,sum2));
    }
} Main
import java.util.*;
public class Main{
	public static void main(String[] args){
    	Scanner sc = new Scanner(System.in);
      int n = sc.nextInt();
      int m = sc.nextInt();
      int x = sc.nextInt();
      int[] a = new int[m];
      for(int i = 0;i < m;i++)a[i] = sc.nextInt();
      int sum1 = 0;
      int sum2 = 0;
      int x1 = x;
      int x2 = x;
      for(int i = 0;i<m;i++){
      	if(a[i]<x)sum1++;
      }
      for(int i = 0;i < m;i++){
      	if(x<a[i])sum2++;
      }
      System.out.println(Math.min(sum1,sum2));
    }
}