

import java.util.Scanner;

public class Main {

	//n = 5
	//1 2 3 4 5 6
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int n = scanner.nextInt();
		int m = scanner.nextInt();
		int x = scanner.nextInt();
		int[] a = new int[m + 1];
		
		for (int i = 1; i <= m; i++) {
			a[i] = scanner.nextInt();
		}
		
		int ans1 = 0;
		
		for (int i = x; i <= n; i++) {
			for (int j = 1; j <= m; j++) {
				if (i == a[j]) {
					ans1 += 1;
				}
			}
			
		}
		
		int ans2 = 0;
		for (int i = x; i >=  0; i--) {
			for (int j = 1; j <= m; j++) {
				if (i == a[j]) {
					ans2 += 1;
				}
			}
		}
		
		int ans3 = Math.min(ans1, ans2);
		System.out.println(ans3);
		scanner.close();

	}

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

	//n = 5
	//1 2 3 4 5 6
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int n = scanner.nextInt();
		int m = scanner.nextInt();
		int x = scanner.nextInt();
		int[] a = new int[m + 1];
		
		for (int i = 1; i <= m; i++) {
			a[i] = scanner.nextInt();
		}
		
		int ans1 = 0;
		
		for (int i = x; i <= n; i++) {
			for (int j = 1; j <= m; j++) {
				if (i == a[j]) {
					ans1 += 1;
				}
			}
			
		}
		
		int ans2 = 0;
		for (int i = x; i >=  0; i--) {
			for (int j = 1; j <= m; j++) {
				if (i == a[j]) {
					ans2 += 1;
				}
			}
		}
		
		int ans3 = Math.min(ans1, ans2);
		System.out.println(ans3);
		scanner.close();

	}

} Main //n = 5
	//1 2 3 4 5 6
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int n = scanner.nextInt();
		int m = scanner.nextInt();
		int x = scanner.nextInt();
		int[] a = new int[m + 1];
		
		for (int i = 1; i <= m; i++) {
			a[i] = scanner.nextInt();
		}
		
		int ans1 = 0;
		
		for (int i = x; i <= n; i++) {
			for (int j = 1; j <= m; j++) {
				if (i == a[j]) {
					ans1 += 1;
				}
			}
			
		}
		
		int ans2 = 0;
		for (int i = x; i >=  0; i--) {
			for (int j = 1; j <= m; j++) {
				if (i == a[j]) {
					ans2 += 1;
				}
			}
		}
		
		int ans3 = Math.min(ans1, ans2);
		System.out.println(ans3);
		scanner.close();

	} main {
		Scanner scanner = new Scanner(System.in);
		int n = scanner.nextInt();
		int m = scanner.nextInt();
		int x = scanner.nextInt();
		int[] a = new int[m + 1];
		
		for (int i = 1; i <= m; i++) {
			a[i] = scanner.nextInt();
		}
		
		int ans1 = 0;
		
		for (int i = x; i <= n; i++) {
			for (int j = 1; j <= m; j++) {
				if (i == a[j]) {
					ans1 += 1;
				}
			}
			
		}
		
		int ans2 = 0;
		for (int i = x; i >=  0; i--) {
			for (int j = 1; j <= m; j++) {
				if (i == a[j]) {
					ans2 += 1;
				}
			}
		}
		
		int ans3 = Math.min(ans1, ans2);
		System.out.println(ans3);
		scanner.close();

	} Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int n = scanner.nextInt(); n scanner.nextInt() scanner.nextInt scanner int m = scanner.nextInt(); m scanner.nextInt() scanner.nextInt scanner int x = scanner.nextInt(); x scanner.nextInt() scanner.nextInt scanner int[] a = new int[m + 1]; a new int[m + 1] m + 1 m 1 for (int i = 1; i <= m; i++) {
			a[i] = scanner.nextInt();
		} int i = 1; int i = 1; i 1 i <= m i m i++ i++ i {
			a[i] = scanner.nextInt();
		} {
			a[i] = scanner.nextInt();
		} a[i] = scanner.nextInt() a[i] a i scanner.nextInt() scanner.nextInt scanner int ans1 = 0; ans1 0 for (int i = x; i <= n; i++) {
			for (int j = 1; j <= m; j++) {
				if (i == a[j]) {
					ans1 += 1;
				}
			}
			
		} int i = x; int i = x; i x i <= n i n i++ i++ i {
			for (int j = 1; j <= m; j++) {
				if (i == a[j]) {
					ans1 += 1;
				}
			}
			
		} {
			for (int j = 1; j <= m; j++) {
				if (i == a[j]) {
					ans1 += 1;
				}
			}
			
		} for (int j = 1; j <= m; j++) {
				if (i == a[j]) {
					ans1 += 1;
				}
			} int j = 1; int j = 1; j 1 j <= m j m j++ j++ j {
				if (i == a[j]) {
					ans1 += 1;
				}
			} {
				if (i == a[j]) {
					ans1 += 1;
				}
			} if (i == a[j]) {
					ans1 += 1;
				} i == a[j] i a[j] a j {
					ans1 += 1;
				} ans1 += 1 ans1 1 int ans2 = 0; ans2 0 for (int i = x; i >=  0; i--) {
			for (int j = 1; j <= m; j++) {
				if (i == a[j]) {
					ans2 += 1;
				}
			}
		} int i = x; int i = x; i x i >=  0 i 0 i-- i-- i {
			for (int j = 1; j <= m; j++) {
				if (i == a[j]) {
					ans2 += 1;
				}
			}
		} {
			for (int j = 1; j <= m; j++) {
				if (i == a[j]) {
					ans2 += 1;
				}
			}
		} for (int j = 1; j <= m; j++) {
				if (i == a[j]) {
					ans2 += 1;
				}
			} int j = 1; int j = 1; j 1 j <= m j m j++ j++ j {
				if (i == a[j]) {
					ans2 += 1;
				}
			} {
				if (i == a[j]) {
					ans2 += 1;
				}
			} if (i == a[j]) {
					ans2 += 1;
				} i == a[j] i a[j] a j {
					ans2 += 1;
				} ans2 += 1 ans2 1 int ans3 = Math.min(ans1, ans2); ans3 Math.min(ans1, ans2) Math.min Math ans1 ans2 System.out.println(ans3) System.out.println System.out System System.out ans3 scanner.close() scanner.close scanner String[] args args public class Main {

	//n = 5
	//1 2 3 4 5 6
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int n = scanner.nextInt();
		int m = scanner.nextInt();
		int x = scanner.nextInt();
		int[] a = new int[m + 1];
		
		for (int i = 1; i <= m; i++) {
			a[i] = scanner.nextInt();
		}
		
		int ans1 = 0;
		
		for (int i = x; i <= n; i++) {
			for (int j = 1; j <= m; j++) {
				if (i == a[j]) {
					ans1 += 1;
				}
			}
			
		}
		
		int ans2 = 0;
		for (int i = x; i >=  0; i--) {
			for (int j = 1; j <= m; j++) {
				if (i == a[j]) {
					ans2 += 1;
				}
			}
		}
		
		int ans3 = Math.min(ans1, ans2);
		System.out.println(ans3);
		scanner.close();

	}

} public class Main {

	//n = 5
	//1 2 3 4 5 6
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int n = scanner.nextInt();
		int m = scanner.nextInt();
		int x = scanner.nextInt();
		int[] a = new int[m + 1];
		
		for (int i = 1; i <= m; i++) {
			a[i] = scanner.nextInt();
		}
		
		int ans1 = 0;
		
		for (int i = x; i <= n; i++) {
			for (int j = 1; j <= m; j++) {
				if (i == a[j]) {
					ans1 += 1;
				}
			}
			
		}
		
		int ans2 = 0;
		for (int i = x; i >=  0; i--) {
			for (int j = 1; j <= m; j++) {
				if (i == a[j]) {
					ans2 += 1;
				}
			}
		}
		
		int ans3 = Math.min(ans1, ans2);
		System.out.println(ans3);
		scanner.close();

	}

} Main


import java.util.Scanner;

public class Main {

	//n = 5
	//1 2 3 4 5 6
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int n = scanner.nextInt();
		int m = scanner.nextInt();
		int x = scanner.nextInt();
		int[] a = new int[m + 1];
		
		for (int i = 1; i <= m; i++) {
			a[i] = scanner.nextInt();
		}
		
		int ans1 = 0;
		
		for (int i = x; i <= n; i++) {
			for (int j = 1; j <= m; j++) {
				if (i == a[j]) {
					ans1 += 1;
				}
			}
			
		}
		
		int ans2 = 0;
		for (int i = x; i >=  0; i--) {
			for (int j = 1; j <= m; j++) {
				if (i == a[j]) {
					ans2 += 1;
				}
			}
		}
		
		int ans3 = Math.min(ans1, ans2);
		System.out.println(ans3);
		scanner.close();

	}

}
