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();
   Integer[] ch = new Integer[N];
   for(int i=0;i<M;i++) ch[i] = sc.nextInt();
   
   int sum0 = 0 ;
   int sumN = 0 ;
   for(int i=1;i<X;i++)
   {
     if(Arrays.asList(ch).contains(i)) sum0++;
   }
      for(int i=X;i<N;i++)
   {
     if(Arrays.asList(ch).contains(i)) sumN++;
   }
   if(sum0<sumN) System.out.println(sum0);
   else System.out.println(sumN);
 }
} 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();
   Integer[] ch = new Integer[N];
   for(int i=0;i<M;i++) ch[i] = sc.nextInt();
   
   int sum0 = 0 ;
   int sumN = 0 ;
   for(int i=1;i<X;i++)
   {
     if(Arrays.asList(ch).contains(i)) sum0++;
   }
      for(int i=X;i<N;i++)
   {
     if(Arrays.asList(ch).contains(i)) sumN++;
   }
   if(sum0<sumN) System.out.println(sum0);
   else System.out.println(sumN);
 }
} 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();
   Integer[] ch = new Integer[N];
   for(int i=0;i<M;i++) ch[i] = sc.nextInt();
   
   int sum0 = 0 ;
   int sumN = 0 ;
   for(int i=1;i<X;i++)
   {
     if(Arrays.asList(ch).contains(i)) sum0++;
   }
      for(int i=X;i<N;i++)
   {
     if(Arrays.asList(ch).contains(i)) sumN++;
   }
   if(sum0<sumN) System.out.println(sum0);
   else System.out.println(sumN);
 } main {
   Scanner sc = new Scanner(System.in);
 
   int N = sc.nextInt();
   int M = sc.nextInt();
   int X = sc.nextInt();
   Integer[] ch = new Integer[N];
   for(int i=0;i<M;i++) ch[i] = sc.nextInt();
   
   int sum0 = 0 ;
   int sumN = 0 ;
   for(int i=1;i<X;i++)
   {
     if(Arrays.asList(ch).contains(i)) sum0++;
   }
      for(int i=X;i<N;i++)
   {
     if(Arrays.asList(ch).contains(i)) sumN++;
   }
   if(sum0<sumN) System.out.println(sum0);
   else System.out.println(sumN);
 } 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 Integer[] ch = new Integer[N]; ch new Integer[N] N for(int i=0;i<M;i++) ch[i] = sc.nextInt(); int i=0; int i=0; i 0 i<M i M i++ i++ i ch[i] = sc.nextInt(); ch[i] = sc.nextInt() ch[i] ch i sc.nextInt() sc.nextInt sc int sum0 = 0 ; sum0 0 int sumN = 0 ; sumN 0 for(int i=1;i<X;i++)
   {
     if(Arrays.asList(ch).contains(i)) sum0++;
   } int i=1; int i=1; i 1 i<X i X i++ i++ i {
     if(Arrays.asList(ch).contains(i)) sum0++;
   } {
     if(Arrays.asList(ch).contains(i)) sum0++;
   } if(Arrays.asList(ch).contains(i)) sum0++; Arrays.asList(ch).contains(i) Arrays.asList(ch).contains Arrays.asList(ch) Arrays.asList Arrays ch i sum0++ sum0 for(int i=X;i<N;i++)
   {
     if(Arrays.asList(ch).contains(i)) sumN++;
   } int i=X; int i=X; i X i<N i N i++ i++ i {
     if(Arrays.asList(ch).contains(i)) sumN++;
   } {
     if(Arrays.asList(ch).contains(i)) sumN++;
   } if(Arrays.asList(ch).contains(i)) sumN++; Arrays.asList(ch).contains(i) Arrays.asList(ch).contains Arrays.asList(ch) Arrays.asList Arrays ch i sumN++ sumN if(sum0<sumN) System.out.println(sum0);
   else System.out.println(sumN); sum0<sumN sum0 sumN System.out.println(sum0) System.out.println System.out System System.out sum0 System.out.println(sumN) System.out.println System.out System System.out sumN 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();
   Integer[] ch = new Integer[N];
   for(int i=0;i<M;i++) ch[i] = sc.nextInt();
   
   int sum0 = 0 ;
   int sumN = 0 ;
   for(int i=1;i<X;i++)
   {
     if(Arrays.asList(ch).contains(i)) sum0++;
   }
      for(int i=X;i<N;i++)
   {
     if(Arrays.asList(ch).contains(i)) sumN++;
   }
   if(sum0<sumN) System.out.println(sum0);
   else System.out.println(sumN);
 }
} 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();
   Integer[] ch = new Integer[N];
   for(int i=0;i<M;i++) ch[i] = sc.nextInt();
   
   int sum0 = 0 ;
   int sumN = 0 ;
   for(int i=1;i<X;i++)
   {
     if(Arrays.asList(ch).contains(i)) sum0++;
   }
      for(int i=X;i<N;i++)
   {
     if(Arrays.asList(ch).contains(i)) sumN++;
   }
   if(sum0<sumN) System.out.println(sum0);
   else System.out.println(sumN);
 }
} 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();
   Integer[] ch = new Integer[N];
   for(int i=0;i<M;i++) ch[i] = sc.nextInt();
   
   int sum0 = 0 ;
   int sumN = 0 ;
   for(int i=1;i<X;i++)
   {
     if(Arrays.asList(ch).contains(i)) sum0++;
   }
      for(int i=X;i<N;i++)
   {
     if(Arrays.asList(ch).contains(i)) sumN++;
   }
   if(sum0<sumN) System.out.println(sum0);
   else System.out.println(sumN);
 }
}