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 num1 = 0;
		int num2 = 0;
		for(int i=0; a[i]<x; i++){
			if(a[i]<x)num1++;
		}
		num2 = m - num1;
		System.out.print(Math.min(num1,num2));
	}
} 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 num1 = 0;
		int num2 = 0;
		for(int i=0; a[i]<x; i++){
			if(a[i]<x)num1++;
		}
		num2 = m - num1;
		System.out.print(Math.min(num1,num2));
	}
} 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 num1 = 0;
		int num2 = 0;
		for(int i=0; a[i]<x; i++){
			if(a[i]<x)num1++;
		}
		num2 = m - num1;
		System.out.print(Math.min(num1,num2));
	} 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 num1 = 0;
		int num2 = 0;
		for(int i=0; a[i]<x; i++){
			if(a[i]<x)num1++;
		}
		num2 = m - num1;
		System.out.print(Math.min(num1,num2));
	} 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] = sc.nextInt() a[i] a i sc.nextInt() sc.nextInt sc int num1 = 0; num1 0 int num2 = 0; num2 0 for(int i=0; a[i]<x; i++){
			if(a[i]<x)num1++;
		} int i=0; int i=0; i 0 a[i]<x a[i] a i x i++ i++ i {
			if(a[i]<x)num1++;
		} {
			if(a[i]<x)num1++;
		} if(a[i]<x)num1++; a[i]<x a[i] a i x num1++ num1 num2 = m - num1 num2 m - num1 m num1 System.out.print(Math.min(num1,num2)) System.out.print System.out System System.out Math.min(num1,num2) Math.min Math num1 num2 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 num1 = 0;
		int num2 = 0;
		for(int i=0; a[i]<x; i++){
			if(a[i]<x)num1++;
		}
		num2 = m - num1;
		System.out.print(Math.min(num1,num2));
	}
} 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 num1 = 0;
		int num2 = 0;
		for(int i=0; a[i]<x; i++){
			if(a[i]<x)num1++;
		}
		num2 = m - num1;
		System.out.print(Math.min(num1,num2));
	}
} 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 num1 = 0;
		int num2 = 0;
		for(int i=0; a[i]<x; i++){
			if(a[i]<x)num1++;
		}
		num2 = m - num1;
		System.out.print(Math.min(num1,num2));
	}
}