import java.util.Scanner;

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

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int m = scan.nextInt();
		int x = scan.nextInt();
		int[] a = new int[m];
		for (int i = 0; i < m; i++) {
			a[i] = scan.nextInt();
		}
		int costl = 0;
		int costr = 0;
		for (int i = 1; i < x; i++) {
			for (int j = 0; j < m; j++) {
				if (i == a[j]) costl++;
			}
		}
		for (int i = x+1; i < n; i++) {
			for (int j = 0; j < m; j++) {
				if (i == a[j]) costr++;
			}
		}
		System.out.println(Math.min(costl, costr));
	}
}
