import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.HashSet;

public class Main
{

  public static void main(String[] args) throws IOException
  {
    BufferedReader r = new BufferedReader(new InputStreamReader(System.in), 1);
    String s = r.readLine();
    String[] sl = s.split("[\\s]+");
    int n = Integer.parseInt(sl[0]);
    int m = Integer.parseInt(sl[1]);
    int x = Integer.parseInt(sl[2]);
    HashSet<Integer> hs = new HashSet<>();
    s = r.readLine();
    sl = s.split("[\\s]+");
    for(int i = 0; i < m; i++)
    {
      hs.add(Integer.parseInt(sl[i]));
    }
    //System.out.println(hs);

    int a = 0;
    for(int i = 0; i <= x; i++)
    {
      if(hs.contains(i))
      {
        a++;
      }
    }

    int b = 0;
    for(int i = x; i <= n; i++)
    {
      if(hs.contains(i))
      {
        b++;
      }
    }


    System.out.println(Math.min(a, b));

  }

} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.HashSet; HashSet java.util public class Main
{

  public static void main(String[] args) throws IOException
  {
    BufferedReader r = new BufferedReader(new InputStreamReader(System.in), 1);
    String s = r.readLine();
    String[] sl = s.split("[\\s]+");
    int n = Integer.parseInt(sl[0]);
    int m = Integer.parseInt(sl[1]);
    int x = Integer.parseInt(sl[2]);
    HashSet<Integer> hs = new HashSet<>();
    s = r.readLine();
    sl = s.split("[\\s]+");
    for(int i = 0; i < m; i++)
    {
      hs.add(Integer.parseInt(sl[i]));
    }
    //System.out.println(hs);

    int a = 0;
    for(int i = 0; i <= x; i++)
    {
      if(hs.contains(i))
      {
        a++;
      }
    }

    int b = 0;
    for(int i = x; i <= n; i++)
    {
      if(hs.contains(i))
      {
        b++;
      }
    }


    System.out.println(Math.min(a, b));

  }

} Main public static void main(String[] args) throws IOException
  {
    BufferedReader r = new BufferedReader(new InputStreamReader(System.in), 1);
    String s = r.readLine();
    String[] sl = s.split("[\\s]+");
    int n = Integer.parseInt(sl[0]);
    int m = Integer.parseInt(sl[1]);
    int x = Integer.parseInt(sl[2]);
    HashSet<Integer> hs = new HashSet<>();
    s = r.readLine();
    sl = s.split("[\\s]+");
    for(int i = 0; i < m; i++)
    {
      hs.add(Integer.parseInt(sl[i]));
    }
    //System.out.println(hs);

    int a = 0;
    for(int i = 0; i <= x; i++)
    {
      if(hs.contains(i))
      {
        a++;
      }
    }

    int b = 0;
    for(int i = x; i <= n; i++)
    {
      if(hs.contains(i))
      {
        b++;
      }
    }


    System.out.println(Math.min(a, b));

  } main {
    BufferedReader r = new BufferedReader(new InputStreamReader(System.in), 1);
    String s = r.readLine();
    String[] sl = s.split("[\\s]+");
    int n = Integer.parseInt(sl[0]);
    int m = Integer.parseInt(sl[1]);
    int x = Integer.parseInt(sl[2]);
    HashSet<Integer> hs = new HashSet<>();
    s = r.readLine();
    sl = s.split("[\\s]+");
    for(int i = 0; i < m; i++)
    {
      hs.add(Integer.parseInt(sl[i]));
    }
    //System.out.println(hs);

    int a = 0;
    for(int i = 0; i <= x; i++)
    {
      if(hs.contains(i))
      {
        a++;
      }
    }

    int b = 0;
    for(int i = x; i <= n; i++)
    {
      if(hs.contains(i))
      {
        b++;
      }
    }


    System.out.println(Math.min(a, b));

  } BufferedReader r = new BufferedReader(new InputStreamReader(System.in), 1); r new BufferedReader(new InputStreamReader(System.in), 1) String s = r.readLine(); s r.readLine() r.readLine r String[] sl = s.split("[\\s]+"); sl s.split("[\\s]+") s.split s "[\\s]+" int n = Integer.parseInt(sl[0]); n Integer.parseInt(sl[0]) Integer.parseInt Integer sl[0] sl 0 int m = Integer.parseInt(sl[1]); m Integer.parseInt(sl[1]) Integer.parseInt Integer sl[1] sl 1 int x = Integer.parseInt(sl[2]); x Integer.parseInt(sl[2]) Integer.parseInt Integer sl[2] sl 2 HashSet<Integer> hs = new HashSet<>(); hs new HashSet<>() s = r.readLine() s r.readLine() r.readLine r sl = s.split("[\\s]+") sl s.split("[\\s]+") s.split s "[\\s]+" for(int i = 0; i < m; i++)
    {
      hs.add(Integer.parseInt(sl[i]));
    } int i = 0; int i = 0; i 0 i < m i m i++ i++ i {
      hs.add(Integer.parseInt(sl[i]));
    } {
      hs.add(Integer.parseInt(sl[i]));
    } hs.add(Integer.parseInt(sl[i])) hs.add hs Integer.parseInt(sl[i]) Integer.parseInt Integer sl[i] sl i int a = 0; a 0 for(int i = 0; i <= x; i++)
    {
      if(hs.contains(i))
      {
        a++;
      }
    } int i = 0; int i = 0; i 0 i <= x i x i++ i++ i {
      if(hs.contains(i))
      {
        a++;
      }
    } {
      if(hs.contains(i))
      {
        a++;
      }
    } if(hs.contains(i))
      {
        a++;
      } hs.contains(i) hs.contains hs i {
        a++;
      } a++ a int b = 0; b 0 for(int i = x; i <= n; i++)
    {
      if(hs.contains(i))
      {
        b++;
      }
    } int i = x; int i = x; i x i <= n i n i++ i++ i {
      if(hs.contains(i))
      {
        b++;
      }
    } {
      if(hs.contains(i))
      {
        b++;
      }
    } if(hs.contains(i))
      {
        b++;
      } hs.contains(i) hs.contains hs i {
        b++;
      } b++ b System.out.println(Math.min(a, b)) System.out.println System.out System System.out Math.min(a, b) Math.min Math a b String[] args args public class Main
{

  public static void main(String[] args) throws IOException
  {
    BufferedReader r = new BufferedReader(new InputStreamReader(System.in), 1);
    String s = r.readLine();
    String[] sl = s.split("[\\s]+");
    int n = Integer.parseInt(sl[0]);
    int m = Integer.parseInt(sl[1]);
    int x = Integer.parseInt(sl[2]);
    HashSet<Integer> hs = new HashSet<>();
    s = r.readLine();
    sl = s.split("[\\s]+");
    for(int i = 0; i < m; i++)
    {
      hs.add(Integer.parseInt(sl[i]));
    }
    //System.out.println(hs);

    int a = 0;
    for(int i = 0; i <= x; i++)
    {
      if(hs.contains(i))
      {
        a++;
      }
    }

    int b = 0;
    for(int i = x; i <= n; i++)
    {
      if(hs.contains(i))
      {
        b++;
      }
    }


    System.out.println(Math.min(a, b));

  }

} public class Main
{

  public static void main(String[] args) throws IOException
  {
    BufferedReader r = new BufferedReader(new InputStreamReader(System.in), 1);
    String s = r.readLine();
    String[] sl = s.split("[\\s]+");
    int n = Integer.parseInt(sl[0]);
    int m = Integer.parseInt(sl[1]);
    int x = Integer.parseInt(sl[2]);
    HashSet<Integer> hs = new HashSet<>();
    s = r.readLine();
    sl = s.split("[\\s]+");
    for(int i = 0; i < m; i++)
    {
      hs.add(Integer.parseInt(sl[i]));
    }
    //System.out.println(hs);

    int a = 0;
    for(int i = 0; i <= x; i++)
    {
      if(hs.contains(i))
      {
        a++;
      }
    }

    int b = 0;
    for(int i = x; i <= n; i++)
    {
      if(hs.contains(i))
      {
        b++;
      }
    }


    System.out.println(Math.min(a, b));

  }

} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.HashSet;

public class Main
{

  public static void main(String[] args) throws IOException
  {
    BufferedReader r = new BufferedReader(new InputStreamReader(System.in), 1);
    String s = r.readLine();
    String[] sl = s.split("[\\s]+");
    int n = Integer.parseInt(sl[0]);
    int m = Integer.parseInt(sl[1]);
    int x = Integer.parseInt(sl[2]);
    HashSet<Integer> hs = new HashSet<>();
    s = r.readLine();
    sl = s.split("[\\s]+");
    for(int i = 0; i < m; i++)
    {
      hs.add(Integer.parseInt(sl[i]));
    }
    //System.out.println(hs);

    int a = 0;
    for(int i = 0; i <= x; i++)
    {
      if(hs.contains(i))
      {
        a++;
      }
    }

    int b = 0;
    for(int i = x; i <= n; i++)
    {
      if(hs.contains(i))
      {
        b++;
      }
    }


    System.out.println(Math.min(a, b));

  }

}
