import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.nio.charset.StandardCharsets;


public class Main {
	
	static int n,m,x;
	static int[] a = new int[101];
	public static void main(String[] args) throws IOException {
		InputStreamReader reader = new InputStreamReader(System.in, StandardCharsets.UTF_8);
	    BufferedReader in = new BufferedReader(reader);
		
		String s = in.readLine();
		String[] as = s.split(" ");
		n = Integer.parseInt(as[0]);
		m = Integer.parseInt(as[1]);
		x = Integer.parseInt(as[2]);
		
		s = in.readLine();
		String[] as2 = s.split(" ");
		
		for (int i=0; i < m; i++) {
			a[Integer.parseInt(as2[i])] = 1;
		}
		System.out.println(solve());
	}

	private static int solve() {
		int ans0 = 0;
		int ansN = 0;
		for(int i = x; i < n; i++) {
			
			ans0 += a[i];
		}
		if(ans0==0) return 0;
		for(int i = x; i > 0; i--) {
			ansN += a[i];
		}
		if(ans0>ansN) {
			return ansN;
		} else {
			return ans0;
		}
		
	}

	
	
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io import java.nio.charset.StandardCharsets; StandardCharsets java.nio.charset public class Main {
	
	static int n,m,x;
	static int[] a = new int[101];
	public static void main(String[] args) throws IOException {
		InputStreamReader reader = new InputStreamReader(System.in, StandardCharsets.UTF_8);
	    BufferedReader in = new BufferedReader(reader);
		
		String s = in.readLine();
		String[] as = s.split(" ");
		n = Integer.parseInt(as[0]);
		m = Integer.parseInt(as[1]);
		x = Integer.parseInt(as[2]);
		
		s = in.readLine();
		String[] as2 = s.split(" ");
		
		for (int i=0; i < m; i++) {
			a[Integer.parseInt(as2[i])] = 1;
		}
		System.out.println(solve());
	}

	private static int solve() {
		int ans0 = 0;
		int ansN = 0;
		for(int i = x; i < n; i++) {
			
			ans0 += a[i];
		}
		if(ans0==0) return 0;
		for(int i = x; i > 0; i--) {
			ansN += a[i];
		}
		if(ans0>ansN) {
			return ansN;
		} else {
			return ans0;
		}
		
	}

	
	
} Main static int n n m m x; x static int[] a = new int[101]; a new int[101] 101 public static void main(String[] args) throws IOException {
		InputStreamReader reader = new InputStreamReader(System.in, StandardCharsets.UTF_8);
	    BufferedReader in = new BufferedReader(reader);
		
		String s = in.readLine();
		String[] as = s.split(" ");
		n = Integer.parseInt(as[0]);
		m = Integer.parseInt(as[1]);
		x = Integer.parseInt(as[2]);
		
		s = in.readLine();
		String[] as2 = s.split(" ");
		
		for (int i=0; i < m; i++) {
			a[Integer.parseInt(as2[i])] = 1;
		}
		System.out.println(solve());
	} main {
		InputStreamReader reader = new InputStreamReader(System.in, StandardCharsets.UTF_8);
	    BufferedReader in = new BufferedReader(reader);
		
		String s = in.readLine();
		String[] as = s.split(" ");
		n = Integer.parseInt(as[0]);
		m = Integer.parseInt(as[1]);
		x = Integer.parseInt(as[2]);
		
		s = in.readLine();
		String[] as2 = s.split(" ");
		
		for (int i=0; i < m; i++) {
			a[Integer.parseInt(as2[i])] = 1;
		}
		System.out.println(solve());
	} InputStreamReader reader = new InputStreamReader(System.in, StandardCharsets.UTF_8); reader new InputStreamReader(System.in, StandardCharsets.UTF_8) BufferedReader in = new BufferedReader(reader); in new BufferedReader(reader) String s = in.readLine(); s in.readLine() in.readLine in String[] as = s.split(" "); as s.split(" ") s.split s " " n = Integer.parseInt(as[0]) n Integer.parseInt(as[0]) Integer.parseInt Integer as[0] as 0 m = Integer.parseInt(as[1]) m Integer.parseInt(as[1]) Integer.parseInt Integer as[1] as 1 x = Integer.parseInt(as[2]) x Integer.parseInt(as[2]) Integer.parseInt Integer as[2] as 2 s = in.readLine() s in.readLine() in.readLine in String[] as2 = s.split(" "); as2 s.split(" ") s.split s " " for (int i=0; i < m; i++) {
			a[Integer.parseInt(as2[i])] = 1;
		} int i=0; int i=0; i 0 i < m i m i++ i++ i {
			a[Integer.parseInt(as2[i])] = 1;
		} {
			a[Integer.parseInt(as2[i])] = 1;
		} a[Integer.parseInt(as2[i])] = 1 a[Integer.parseInt(as2[i])] a Integer.parseInt(as2[i]) Integer.parseInt Integer as2[i] as2 i 1 System.out.println(solve()) System.out.println System.out System System.out solve() solve String[] args args private static int solve() {
		int ans0 = 0;
		int ansN = 0;
		for(int i = x; i < n; i++) {
			
			ans0 += a[i];
		}
		if(ans0==0) return 0;
		for(int i = x; i > 0; i--) {
			ansN += a[i];
		}
		if(ans0>ansN) {
			return ansN;
		} else {
			return ans0;
		}
		
	} solve {
		int ans0 = 0;
		int ansN = 0;
		for(int i = x; i < n; i++) {
			
			ans0 += a[i];
		}
		if(ans0==0) return 0;
		for(int i = x; i > 0; i--) {
			ansN += a[i];
		}
		if(ans0>ansN) {
			return ansN;
		} else {
			return ans0;
		}
		
	} int ans0 = 0; ans0 0 int ansN = 0; ansN 0 for(int i = x; i < n; i++) {
			
			ans0 += a[i];
		} int i = x; int i = x; i x i < n i n i++ i++ i {
			
			ans0 += a[i];
		} {
			
			ans0 += a[i];
		} ans0 += a[i] ans0 a[i] a i if(ans0==0) return 0; ans0==0 ans0 0 return 0; 0 for(int i = x; i > 0; i--) {
			ansN += a[i];
		} int i = x; int i = x; i x i > 0 i 0 i-- i-- i {
			ansN += a[i];
		} {
			ansN += a[i];
		} ansN += a[i] ansN a[i] a i if(ans0>ansN) {
			return ansN;
		} else {
			return ans0;
		} ans0>ansN ans0 ansN {
			return ansN;
		} return ansN; ansN {
			return ans0;
		} return ans0; ans0 public class Main {
	
	static int n,m,x;
	static int[] a = new int[101];
	public static void main(String[] args) throws IOException {
		InputStreamReader reader = new InputStreamReader(System.in, StandardCharsets.UTF_8);
	    BufferedReader in = new BufferedReader(reader);
		
		String s = in.readLine();
		String[] as = s.split(" ");
		n = Integer.parseInt(as[0]);
		m = Integer.parseInt(as[1]);
		x = Integer.parseInt(as[2]);
		
		s = in.readLine();
		String[] as2 = s.split(" ");
		
		for (int i=0; i < m; i++) {
			a[Integer.parseInt(as2[i])] = 1;
		}
		System.out.println(solve());
	}

	private static int solve() {
		int ans0 = 0;
		int ansN = 0;
		for(int i = x; i < n; i++) {
			
			ans0 += a[i];
		}
		if(ans0==0) return 0;
		for(int i = x; i > 0; i--) {
			ansN += a[i];
		}
		if(ans0>ansN) {
			return ansN;
		} else {
			return ans0;
		}
		
	}

	
	
} public class Main {
	
	static int n,m,x;
	static int[] a = new int[101];
	public static void main(String[] args) throws IOException {
		InputStreamReader reader = new InputStreamReader(System.in, StandardCharsets.UTF_8);
	    BufferedReader in = new BufferedReader(reader);
		
		String s = in.readLine();
		String[] as = s.split(" ");
		n = Integer.parseInt(as[0]);
		m = Integer.parseInt(as[1]);
		x = Integer.parseInt(as[2]);
		
		s = in.readLine();
		String[] as2 = s.split(" ");
		
		for (int i=0; i < m; i++) {
			a[Integer.parseInt(as2[i])] = 1;
		}
		System.out.println(solve());
	}

	private static int solve() {
		int ans0 = 0;
		int ansN = 0;
		for(int i = x; i < n; i++) {
			
			ans0 += a[i];
		}
		if(ans0==0) return 0;
		for(int i = x; i > 0; i--) {
			ansN += a[i];
		}
		if(ans0>ansN) {
			return ansN;
		} else {
			return ans0;
		}
		
	}

	
	
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.nio.charset.StandardCharsets;


public class Main {
	
	static int n,m,x;
	static int[] a = new int[101];
	public static void main(String[] args) throws IOException {
		InputStreamReader reader = new InputStreamReader(System.in, StandardCharsets.UTF_8);
	    BufferedReader in = new BufferedReader(reader);
		
		String s = in.readLine();
		String[] as = s.split(" ");
		n = Integer.parseInt(as[0]);
		m = Integer.parseInt(as[1]);
		x = Integer.parseInt(as[2]);
		
		s = in.readLine();
		String[] as2 = s.split(" ");
		
		for (int i=0; i < m; i++) {
			a[Integer.parseInt(as2[i])] = 1;
		}
		System.out.println(solve());
	}

	private static int solve() {
		int ans0 = 0;
		int ansN = 0;
		for(int i = x; i < n; i++) {
			
			ans0 += a[i];
		}
		if(ans0==0) return 0;
		for(int i = x; i > 0; i--) {
			ansN += a[i];
		}
		if(ans0>ansN) {
			return ansN;
		} else {
			return ans0;
		}
		
	}

	
	
}