import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int line = sc.nextInt();
		int spotCount = sc.nextInt();
		int firstSpot = sc.nextInt();
		int[] dangerousZone = new int[spotCount];
		int leftSpot = 0;
		int rightSpot = 0;
		for (int i = 0; i < spotCount; i++) {
			dangerousZone[i] = sc.nextInt();
			if (0 < dangerousZone[i] && dangerousZone[i] < firstSpot) {
				leftSpot++;
			} else {
				rightSpot++;
			}
		}
		if (leftSpot > rightSpot) {
			System.out.println(rightSpot);
		} else {
			System.out.println(leftSpot);
		}
		
	}

} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int line = sc.nextInt();
		int spotCount = sc.nextInt();
		int firstSpot = sc.nextInt();
		int[] dangerousZone = new int[spotCount];
		int leftSpot = 0;
		int rightSpot = 0;
		for (int i = 0; i < spotCount; i++) {
			dangerousZone[i] = sc.nextInt();
			if (0 < dangerousZone[i] && dangerousZone[i] < firstSpot) {
				leftSpot++;
			} else {
				rightSpot++;
			}
		}
		if (leftSpot > rightSpot) {
			System.out.println(rightSpot);
		} else {
			System.out.println(leftSpot);
		}
		
	}

} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int line = sc.nextInt();
		int spotCount = sc.nextInt();
		int firstSpot = sc.nextInt();
		int[] dangerousZone = new int[spotCount];
		int leftSpot = 0;
		int rightSpot = 0;
		for (int i = 0; i < spotCount; i++) {
			dangerousZone[i] = sc.nextInt();
			if (0 < dangerousZone[i] && dangerousZone[i] < firstSpot) {
				leftSpot++;
			} else {
				rightSpot++;
			}
		}
		if (leftSpot > rightSpot) {
			System.out.println(rightSpot);
		} else {
			System.out.println(leftSpot);
		}
		
	} main {
		Scanner sc = new Scanner(System.in);
		int line = sc.nextInt();
		int spotCount = sc.nextInt();
		int firstSpot = sc.nextInt();
		int[] dangerousZone = new int[spotCount];
		int leftSpot = 0;
		int rightSpot = 0;
		for (int i = 0; i < spotCount; i++) {
			dangerousZone[i] = sc.nextInt();
			if (0 < dangerousZone[i] && dangerousZone[i] < firstSpot) {
				leftSpot++;
			} else {
				rightSpot++;
			}
		}
		if (leftSpot > rightSpot) {
			System.out.println(rightSpot);
		} else {
			System.out.println(leftSpot);
		}
		
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int line = sc.nextInt(); line sc.nextInt() sc.nextInt sc int spotCount = sc.nextInt(); spotCount sc.nextInt() sc.nextInt sc int firstSpot = sc.nextInt(); firstSpot sc.nextInt() sc.nextInt sc int[] dangerousZone = new int[spotCount]; dangerousZone new int[spotCount] spotCount int leftSpot = 0; leftSpot 0 int rightSpot = 0; rightSpot 0 for (int i = 0; i < spotCount; i++) {
			dangerousZone[i] = sc.nextInt();
			if (0 < dangerousZone[i] && dangerousZone[i] < firstSpot) {
				leftSpot++;
			} else {
				rightSpot++;
			}
		} int i = 0; int i = 0; i 0 i < spotCount i spotCount i++ i++ i {
			dangerousZone[i] = sc.nextInt();
			if (0 < dangerousZone[i] && dangerousZone[i] < firstSpot) {
				leftSpot++;
			} else {
				rightSpot++;
			}
		} {
			dangerousZone[i] = sc.nextInt();
			if (0 < dangerousZone[i] && dangerousZone[i] < firstSpot) {
				leftSpot++;
			} else {
				rightSpot++;
			}
		} dangerousZone[i] = sc.nextInt() dangerousZone[i] dangerousZone i sc.nextInt() sc.nextInt sc if (0 < dangerousZone[i] && dangerousZone[i] < firstSpot) {
				leftSpot++;
			} else {
				rightSpot++;
			} 0 < dangerousZone[i] && dangerousZone[i] < firstSpot 0 < dangerousZone[i] 0 dangerousZone[i] dangerousZone i dangerousZone[i] < firstSpot dangerousZone[i] dangerousZone i firstSpot {
				leftSpot++;
			} leftSpot++ leftSpot {
				rightSpot++;
			} rightSpot++ rightSpot if (leftSpot > rightSpot) {
			System.out.println(rightSpot);
		} else {
			System.out.println(leftSpot);
		} leftSpot > rightSpot leftSpot rightSpot {
			System.out.println(rightSpot);
		} System.out.println(rightSpot) System.out.println System.out System System.out rightSpot {
			System.out.println(leftSpot);
		} System.out.println(leftSpot) System.out.println System.out System System.out leftSpot String[] args args public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int line = sc.nextInt();
		int spotCount = sc.nextInt();
		int firstSpot = sc.nextInt();
		int[] dangerousZone = new int[spotCount];
		int leftSpot = 0;
		int rightSpot = 0;
		for (int i = 0; i < spotCount; i++) {
			dangerousZone[i] = sc.nextInt();
			if (0 < dangerousZone[i] && dangerousZone[i] < firstSpot) {
				leftSpot++;
			} else {
				rightSpot++;
			}
		}
		if (leftSpot > rightSpot) {
			System.out.println(rightSpot);
		} else {
			System.out.println(leftSpot);
		}
		
	}

} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int line = sc.nextInt();
		int spotCount = sc.nextInt();
		int firstSpot = sc.nextInt();
		int[] dangerousZone = new int[spotCount];
		int leftSpot = 0;
		int rightSpot = 0;
		for (int i = 0; i < spotCount; i++) {
			dangerousZone[i] = sc.nextInt();
			if (0 < dangerousZone[i] && dangerousZone[i] < firstSpot) {
				leftSpot++;
			} else {
				rightSpot++;
			}
		}
		if (leftSpot > rightSpot) {
			System.out.println(rightSpot);
		} else {
			System.out.println(leftSpot);
		}
		
	}

} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int line = sc.nextInt();
		int spotCount = sc.nextInt();
		int firstSpot = sc.nextInt();
		int[] dangerousZone = new int[spotCount];
		int leftSpot = 0;
		int rightSpot = 0;
		for (int i = 0; i < spotCount; i++) {
			dangerousZone[i] = sc.nextInt();
			if (0 < dangerousZone[i] && dangerousZone[i] < firstSpot) {
				leftSpot++;
			} else {
				rightSpot++;
			}
		}
		if (leftSpot > rightSpot) {
			System.out.println(rightSpot);
		} else {
			System.out.println(leftSpot);
		}
		
	}

}