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];
		int right = 0;
		int left = 0;
		for(int i = 0; i < m; i++) {
			a[i] = sc.nextInt();
		}
		for(int i = 1; i < x; i++) {
			for(int j = 0; j < m; j++) {
				if(i == a[j]) {
					left++;
				}
			}
		}
		for(int i = x+1; i < n; i++) {
			for(int j = 0; j < m; j++) {
				if(i == a[j]) {
					right++;
				}
			}
		}
		if(left <= right) {
			System.out.println(left);
		}
		else {
			System.out.println(right);
		}
		sc.close();
	}

} 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];
		int right = 0;
		int left = 0;
		for(int i = 0; i < m; i++) {
			a[i] = sc.nextInt();
		}
		for(int i = 1; i < x; i++) {
			for(int j = 0; j < m; j++) {
				if(i == a[j]) {
					left++;
				}
			}
		}
		for(int i = x+1; i < n; i++) {
			for(int j = 0; j < m; j++) {
				if(i == a[j]) {
					right++;
				}
			}
		}
		if(left <= right) {
			System.out.println(left);
		}
		else {
			System.out.println(right);
		}
		sc.close();
	}

} 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];
		int right = 0;
		int left = 0;
		for(int i = 0; i < m; i++) {
			a[i] = sc.nextInt();
		}
		for(int i = 1; i < x; i++) {
			for(int j = 0; j < m; j++) {
				if(i == a[j]) {
					left++;
				}
			}
		}
		for(int i = x+1; i < n; i++) {
			for(int j = 0; j < m; j++) {
				if(i == a[j]) {
					right++;
				}
			}
		}
		if(left <= right) {
			System.out.println(left);
		}
		else {
			System.out.println(right);
		}
		sc.close();
	} main {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int m = sc.nextInt();
		int x = sc.nextInt();
		int [] a = new int [m];
		int right = 0;
		int left = 0;
		for(int i = 0; i < m; i++) {
			a[i] = sc.nextInt();
		}
		for(int i = 1; i < x; i++) {
			for(int j = 0; j < m; j++) {
				if(i == a[j]) {
					left++;
				}
			}
		}
		for(int i = x+1; i < n; i++) {
			for(int j = 0; j < m; j++) {
				if(i == a[j]) {
					right++;
				}
			}
		}
		if(left <= right) {
			System.out.println(left);
		}
		else {
			System.out.println(right);
		}
		sc.close();
	} 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 int right = 0; right 0 int left = 0; left 0 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 for(int i = 1; i < x; i++) {
			for(int j = 0; j < m; j++) {
				if(i == a[j]) {
					left++;
				}
			}
		} int i = 1; int i = 1; i 1 i < x i x i++ i++ i {
			for(int j = 0; j < m; j++) {
				if(i == a[j]) {
					left++;
				}
			}
		} {
			for(int j = 0; j < m; j++) {
				if(i == a[j]) {
					left++;
				}
			}
		} for(int j = 0; j < m; j++) {
				if(i == a[j]) {
					left++;
				}
			} int j = 0; int j = 0; j 0 j < m j m j++ j++ j {
				if(i == a[j]) {
					left++;
				}
			} {
				if(i == a[j]) {
					left++;
				}
			} if(i == a[j]) {
					left++;
				} i == a[j] i a[j] a j {
					left++;
				} left++ left for(int i = x+1; i < n; i++) {
			for(int j = 0; j < m; j++) {
				if(i == a[j]) {
					right++;
				}
			}
		} int i = x+1; int i = x+1; i x+1 x 1 i < n i n i++ i++ i {
			for(int j = 0; j < m; j++) {
				if(i == a[j]) {
					right++;
				}
			}
		} {
			for(int j = 0; j < m; j++) {
				if(i == a[j]) {
					right++;
				}
			}
		} for(int j = 0; j < m; j++) {
				if(i == a[j]) {
					right++;
				}
			} int j = 0; int j = 0; j 0 j < m j m j++ j++ j {
				if(i == a[j]) {
					right++;
				}
			} {
				if(i == a[j]) {
					right++;
				}
			} if(i == a[j]) {
					right++;
				} i == a[j] i a[j] a j {
					right++;
				} right++ right if(left <= right) {
			System.out.println(left);
		}
		else {
			System.out.println(right);
		} left <= right left right {
			System.out.println(left);
		} System.out.println(left) System.out.println System.out System System.out left {
			System.out.println(right);
		} System.out.println(right) System.out.println System.out System System.out right sc.close() sc.close sc 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];
		int right = 0;
		int left = 0;
		for(int i = 0; i < m; i++) {
			a[i] = sc.nextInt();
		}
		for(int i = 1; i < x; i++) {
			for(int j = 0; j < m; j++) {
				if(i == a[j]) {
					left++;
				}
			}
		}
		for(int i = x+1; i < n; i++) {
			for(int j = 0; j < m; j++) {
				if(i == a[j]) {
					right++;
				}
			}
		}
		if(left <= right) {
			System.out.println(left);
		}
		else {
			System.out.println(right);
		}
		sc.close();
	}

} 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];
		int right = 0;
		int left = 0;
		for(int i = 0; i < m; i++) {
			a[i] = sc.nextInt();
		}
		for(int i = 1; i < x; i++) {
			for(int j = 0; j < m; j++) {
				if(i == a[j]) {
					left++;
				}
			}
		}
		for(int i = x+1; i < n; i++) {
			for(int j = 0; j < m; j++) {
				if(i == a[j]) {
					right++;
				}
			}
		}
		if(left <= right) {
			System.out.println(left);
		}
		else {
			System.out.println(right);
		}
		sc.close();
	}

} 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];
		int right = 0;
		int left = 0;
		for(int i = 0; i < m; i++) {
			a[i] = sc.nextInt();
		}
		for(int i = 1; i < x; i++) {
			for(int j = 0; j < m; j++) {
				if(i == a[j]) {
					left++;
				}
			}
		}
		for(int i = x+1; i < n; i++) {
			for(int j = 0; j < m; j++) {
				if(i == a[j]) {
					right++;
				}
			}
		}
		if(left <= right) {
			System.out.println(left);
		}
		else {
			System.out.println(right);
		}
		sc.close();
	}

}
