import java.util.Scanner;
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();
        int[] a = new int [n+1];
        int[] bit = new int [m+2];
        int cost1 = 0;
        int cost2 = 0;
        for(int i = 1;i <= m;i++){
            bit[i] = sc.nextInt();
        }

        for(int i = 0;i < n+1;i++){
            a[i] = 0;
        }
        int j = 1;
        for(int i = 0;i < n+1;i++){
            if(j == m+1){
                break;
            }
            if(i == bit[j]){
                a[i] = 1;
                j++;
            }
        }
        for(int i = 0;i < x;i++){
            cost1 = cost1 + a[i];
        }
        for(int i = x+1;i < n+1;i++){
            cost2 = cost2 + a[i];
        }
        if(cost1 <= cost2){
            System.out.println(cost1);
        }
        else{
            System.out.println(cost2);
        }
    }
} import java.util.Scanner; Scanner 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();
        int[] a = new int [n+1];
        int[] bit = new int [m+2];
        int cost1 = 0;
        int cost2 = 0;
        for(int i = 1;i <= m;i++){
            bit[i] = sc.nextInt();
        }

        for(int i = 0;i < n+1;i++){
            a[i] = 0;
        }
        int j = 1;
        for(int i = 0;i < n+1;i++){
            if(j == m+1){
                break;
            }
            if(i == bit[j]){
                a[i] = 1;
                j++;
            }
        }
        for(int i = 0;i < x;i++){
            cost1 = cost1 + a[i];
        }
        for(int i = x+1;i < n+1;i++){
            cost2 = cost2 + a[i];
        }
        if(cost1 <= cost2){
            System.out.println(cost1);
        }
        else{
            System.out.println(cost2);
        }
    }
} 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();
        int[] a = new int [n+1];
        int[] bit = new int [m+2];
        int cost1 = 0;
        int cost2 = 0;
        for(int i = 1;i <= m;i++){
            bit[i] = sc.nextInt();
        }

        for(int i = 0;i < n+1;i++){
            a[i] = 0;
        }
        int j = 1;
        for(int i = 0;i < n+1;i++){
            if(j == m+1){
                break;
            }
            if(i == bit[j]){
                a[i] = 1;
                j++;
            }
        }
        for(int i = 0;i < x;i++){
            cost1 = cost1 + a[i];
        }
        for(int i = x+1;i < n+1;i++){
            cost2 = cost2 + a[i];
        }
        if(cost1 <= cost2){
            System.out.println(cost1);
        }
        else{
            System.out.println(cost2);
        }
    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        int x = sc.nextInt();
        int[] a = new int [n+1];
        int[] bit = new int [m+2];
        int cost1 = 0;
        int cost2 = 0;
        for(int i = 1;i <= m;i++){
            bit[i] = sc.nextInt();
        }

        for(int i = 0;i < n+1;i++){
            a[i] = 0;
        }
        int j = 1;
        for(int i = 0;i < n+1;i++){
            if(j == m+1){
                break;
            }
            if(i == bit[j]){
                a[i] = 1;
                j++;
            }
        }
        for(int i = 0;i < x;i++){
            cost1 = cost1 + a[i];
        }
        for(int i = x+1;i < n+1;i++){
            cost2 = cost2 + a[i];
        }
        if(cost1 <= cost2){
            System.out.println(cost1);
        }
        else{
            System.out.println(cost2);
        }
    } 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 int[] a = new int [n+1]; a new int [n+1] n+1 n 1 int[] bit = new int [m+2]; bit new int [m+2] m+2 m 2 int cost1 = 0; cost1 0 int cost2 = 0; cost2 0 for(int i = 1;i <= m;i++){
            bit[i] = sc.nextInt();
        } int i = 1; int i = 1; i 1 i <= m i m i++ i++ i {
            bit[i] = sc.nextInt();
        } {
            bit[i] = sc.nextInt();
        } bit[i] = sc.nextInt() bit[i] bit i sc.nextInt() sc.nextInt sc for(int i = 0;i < n+1;i++){
            a[i] = 0;
        } int i = 0; int i = 0; i 0 i < n+1 i n+1 n 1 i++ i++ i {
            a[i] = 0;
        } {
            a[i] = 0;
        } a[i] = 0 a[i] a i 0 int j = 1; j 1 for(int i = 0;i < n+1;i++){
            if(j == m+1){
                break;
            }
            if(i == bit[j]){
                a[i] = 1;
                j++;
            }
        } int i = 0; int i = 0; i 0 i < n+1 i n+1 n 1 i++ i++ i {
            if(j == m+1){
                break;
            }
            if(i == bit[j]){
                a[i] = 1;
                j++;
            }
        } {
            if(j == m+1){
                break;
            }
            if(i == bit[j]){
                a[i] = 1;
                j++;
            }
        } if(j == m+1){
                break;
            } j == m+1 j m+1 m 1 {
                break;
            } break; if(i == bit[j]){
                a[i] = 1;
                j++;
            } i == bit[j] i bit[j] bit j {
                a[i] = 1;
                j++;
            } a[i] = 1 a[i] a i 1 j++ j for(int i = 0;i < x;i++){
            cost1 = cost1 + a[i];
        } int i = 0; int i = 0; i 0 i < x i x i++ i++ i {
            cost1 = cost1 + a[i];
        } {
            cost1 = cost1 + a[i];
        } cost1 = cost1 + a[i] cost1 cost1 + a[i] cost1 a[i] a i for(int i = x+1;i < n+1;i++){
            cost2 = cost2 + a[i];
        } int i = x+1; int i = x+1; i x+1 x 1 i < n+1 i n+1 n 1 i++ i++ i {
            cost2 = cost2 + a[i];
        } {
            cost2 = cost2 + a[i];
        } cost2 = cost2 + a[i] cost2 cost2 + a[i] cost2 a[i] a i if(cost1 <= cost2){
            System.out.println(cost1);
        }
        else{
            System.out.println(cost2);
        } cost1 <= cost2 cost1 cost2 {
            System.out.println(cost1);
        } System.out.println(cost1) System.out.println System.out System System.out cost1 {
            System.out.println(cost2);
        } System.out.println(cost2) System.out.println System.out System System.out cost2 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();
        int[] a = new int [n+1];
        int[] bit = new int [m+2];
        int cost1 = 0;
        int cost2 = 0;
        for(int i = 1;i <= m;i++){
            bit[i] = sc.nextInt();
        }

        for(int i = 0;i < n+1;i++){
            a[i] = 0;
        }
        int j = 1;
        for(int i = 0;i < n+1;i++){
            if(j == m+1){
                break;
            }
            if(i == bit[j]){
                a[i] = 1;
                j++;
            }
        }
        for(int i = 0;i < x;i++){
            cost1 = cost1 + a[i];
        }
        for(int i = x+1;i < n+1;i++){
            cost2 = cost2 + a[i];
        }
        if(cost1 <= cost2){
            System.out.println(cost1);
        }
        else{
            System.out.println(cost2);
        }
    }
} 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();
        int[] a = new int [n+1];
        int[] bit = new int [m+2];
        int cost1 = 0;
        int cost2 = 0;
        for(int i = 1;i <= m;i++){
            bit[i] = sc.nextInt();
        }

        for(int i = 0;i < n+1;i++){
            a[i] = 0;
        }
        int j = 1;
        for(int i = 0;i < n+1;i++){
            if(j == m+1){
                break;
            }
            if(i == bit[j]){
                a[i] = 1;
                j++;
            }
        }
        for(int i = 0;i < x;i++){
            cost1 = cost1 + a[i];
        }
        for(int i = x+1;i < n+1;i++){
            cost2 = cost2 + a[i];
        }
        if(cost1 <= cost2){
            System.out.println(cost1);
        }
        else{
            System.out.println(cost2);
        }
    }
} Main
import java.util.Scanner;
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();
        int[] a = new int [n+1];
        int[] bit = new int [m+2];
        int cost1 = 0;
        int cost2 = 0;
        for(int i = 1;i <= m;i++){
            bit[i] = sc.nextInt();
        }

        for(int i = 0;i < n+1;i++){
            a[i] = 0;
        }
        int j = 1;
        for(int i = 0;i < n+1;i++){
            if(j == m+1){
                break;
            }
            if(i == bit[j]){
                a[i] = 1;
                j++;
            }
        }
        for(int i = 0;i < x;i++){
            cost1 = cost1 + a[i];
        }
        for(int i = x+1;i < n+1;i++){
            cost2 = cost2 + a[i];
        }
        if(cost1 <= cost2){
            System.out.println(cost1);
        }
        else{
            System.out.println(cost2);
        }
    }
}