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();
		}
		// xから左側のコストを計算
		int lec = 0;
		for (int i = 1; i < x; i++) {
			for (int j = 0; j < m; j++) {
				if (i == a[j]) {
					lec++;
				}
			}
		}
		// xから右側のコストを計算
		int ric = 0;
		for (int i = x + 1; i < n; i++) {
			for (int j = 0; j < m; j++) {
				if (i == a[j]) {
					ric++;
				}
			}
		}
		System.out.println(Math.min(lec, ric));
	}

} 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();
		}
		// xから左側のコストを計算
		int lec = 0;
		for (int i = 1; i < x; i++) {
			for (int j = 0; j < m; j++) {
				if (i == a[j]) {
					lec++;
				}
			}
		}
		// xから右側のコストを計算
		int ric = 0;
		for (int i = x + 1; i < n; i++) {
			for (int j = 0; j < m; j++) {
				if (i == a[j]) {
					ric++;
				}
			}
		}
		System.out.println(Math.min(lec, ric));
	}

} 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();
		}
		// xから左側のコストを計算
		int lec = 0;
		for (int i = 1; i < x; i++) {
			for (int j = 0; j < m; j++) {
				if (i == a[j]) {
					lec++;
				}
			}
		}
		// xから右側のコストを計算
		int ric = 0;
		for (int i = x + 1; i < n; i++) {
			for (int j = 0; j < m; j++) {
				if (i == a[j]) {
					ric++;
				}
			}
		}
		System.out.println(Math.min(lec, ric));
	} 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();
		}
		// xから左側のコストを計算
		int lec = 0;
		for (int i = 1; i < x; i++) {
			for (int j = 0; j < m; j++) {
				if (i == a[j]) {
					lec++;
				}
			}
		}
		// xから右側のコストを計算
		int ric = 0;
		for (int i = x + 1; i < n; i++) {
			for (int j = 0; j < m; j++) {
				if (i == a[j]) {
					ric++;
				}
			}
		}
		System.out.println(Math.min(lec, ric));
	} 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 lec = 0; lec 0 for (int i = 1; i < x; i++) {
			for (int j = 0; j < m; j++) {
				if (i == a[j]) {
					lec++;
				}
			}
		} 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]) {
					lec++;
				}
			}
		} {
			for (int j = 0; j < m; j++) {
				if (i == a[j]) {
					lec++;
				}
			}
		} for (int j = 0; j < m; j++) {
				if (i == a[j]) {
					lec++;
				}
			} int j = 0; int j = 0; j 0 j < m j m j++ j++ j {
				if (i == a[j]) {
					lec++;
				}
			} {
				if (i == a[j]) {
					lec++;
				}
			} if (i == a[j]) {
					lec++;
				} i == a[j] i a[j] a j {
					lec++;
				} lec++ lec int ric = 0; ric 0 for (int i = x + 1; i < n; i++) {
			for (int j = 0; j < m; j++) {
				if (i == a[j]) {
					ric++;
				}
			}
		} 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]) {
					ric++;
				}
			}
		} {
			for (int j = 0; j < m; j++) {
				if (i == a[j]) {
					ric++;
				}
			}
		} for (int j = 0; j < m; j++) {
				if (i == a[j]) {
					ric++;
				}
			} int j = 0; int j = 0; j 0 j < m j m j++ j++ j {
				if (i == a[j]) {
					ric++;
				}
			} {
				if (i == a[j]) {
					ric++;
				}
			} if (i == a[j]) {
					ric++;
				} i == a[j] i a[j] a j {
					ric++;
				} ric++ ric System.out.println(Math.min(lec, ric)) System.out.println System.out System System.out Math.min(lec, ric) Math.min Math lec ric 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();
		}
		// xから左側のコストを計算
		int lec = 0;
		for (int i = 1; i < x; i++) {
			for (int j = 0; j < m; j++) {
				if (i == a[j]) {
					lec++;
				}
			}
		}
		// xから右側のコストを計算
		int ric = 0;
		for (int i = x + 1; i < n; i++) {
			for (int j = 0; j < m; j++) {
				if (i == a[j]) {
					ric++;
				}
			}
		}
		System.out.println(Math.min(lec, ric));
	}

} 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();
		}
		// xから左側のコストを計算
		int lec = 0;
		for (int i = 1; i < x; i++) {
			for (int j = 0; j < m; j++) {
				if (i == a[j]) {
					lec++;
				}
			}
		}
		// xから右側のコストを計算
		int ric = 0;
		for (int i = x + 1; i < n; i++) {
			for (int j = 0; j < m; j++) {
				if (i == a[j]) {
					ric++;
				}
			}
		}
		System.out.println(Math.min(lec, ric));
	}

} 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();
		}
		// xから左側のコストを計算
		int lec = 0;
		for (int i = 1; i < x; i++) {
			for (int j = 0; j < m; j++) {
				if (i == a[j]) {
					lec++;
				}
			}
		}
		// xから右側のコストを計算
		int ric = 0;
		for (int i = x + 1; i < n; i++) {
			for (int j = 0; j < m; j++) {
				if (i == a[j]) {
					ric++;
				}
			}
		}
		System.out.println(Math.min(lec, ric));
	}

}
