import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// N
		int N = sc.nextInt();
		// M
		int M = sc.nextInt();
		// X
		int X = sc.nextInt();
		
		int[] a = new int[M];
		for (int i = 0; i < M; i++) {
			a[i] = sc.nextInt();
		}
		
		int ryouhinn1 =0;
		for (int i = X+1; i < N; i++) {
			for (int j = 0; j < a.length; j++) {
				if (i == a[j]) {
					ryouhinn1++;
				}
			}
		}
		int ryouhinn2 =0;
		for (int i = X-1; i >=0; i--) {
			for (int j = 0; j < a.length; j++) {
				if (i == a[j]) {
					ryouhinn2++;
				}
			}
		}
		
		
		if (ryouhinn1 > ryouhinn2 ) {
			System.out.println(ryouhinn2);
		} else {
			System.out.println(ryouhinn1);
		}
		
//1		// 出力
//		
//		for (int i = 0; i < b; i++) {
//			if (a + i == x) {
//				System.out.println("YES");
//				return;
//			}
//		}
//		System.out.println("NO");
		
		
	}
}


/tmp/hf-datasets-cache/medium/datasets/42704881117311-config-parquet-and-info-qiankunmu-Project_CodeNet-896c9d36/hub/datasets--qiankunmu--Project_CodeNet_Python800_and_Java250/snapshots/c899fde44a77ba1cc14973ed3de064e4ff3aadc7/Project_CodeNet_Java250.tar.gz