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();
        
        int[] map = new int[M];
        for (int i = 0; i < M; i++) {
        	map[i] = sc.nextInt();
        }
        
        int max = 0;
        for (int i = X; i < N; i++) {
        	for (int cost : map) {
        		if (i == cost) {
        			max++;
        		}
        	}
        }
        
        int min = 0;
        for (int i = X; 0 < i; i--) {
        	for (int cost : map) {
        		if (i == cost) {
        			min++;
        		}
        	}
        }
        
        System.out.println(Math.min(max, min));
    }
} 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();
        
        int[] map = new int[M];
        for (int i = 0; i < M; i++) {
        	map[i] = sc.nextInt();
        }
        
        int max = 0;
        for (int i = X; i < N; i++) {
        	for (int cost : map) {
        		if (i == cost) {
        			max++;
        		}
        	}
        }
        
        int min = 0;
        for (int i = X; 0 < i; i--) {
        	for (int cost : map) {
        		if (i == cost) {
        			min++;
        		}
        	}
        }
        
        System.out.println(Math.min(max, min));
    }
} 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[] map = new int[M];
        for (int i = 0; i < M; i++) {
        	map[i] = sc.nextInt();
        }
        
        int max = 0;
        for (int i = X; i < N; i++) {
        	for (int cost : map) {
        		if (i == cost) {
        			max++;
        		}
        	}
        }
        
        int min = 0;
        for (int i = X; 0 < i; i--) {
        	for (int cost : map) {
        		if (i == cost) {
        			min++;
        		}
        	}
        }
        
        System.out.println(Math.min(max, min));
    } main {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int M = sc.nextInt();
        int X = sc.nextInt();
        
        int[] map = new int[M];
        for (int i = 0; i < M; i++) {
        	map[i] = sc.nextInt();
        }
        
        int max = 0;
        for (int i = X; i < N; i++) {
        	for (int cost : map) {
        		if (i == cost) {
        			max++;
        		}
        	}
        }
        
        int min = 0;
        for (int i = X; 0 < i; i--) {
        	for (int cost : map) {
        		if (i == cost) {
        			min++;
        		}
        	}
        }
        
        System.out.println(Math.min(max, min));
    } 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[] map = new int[M]; map new int[M] M for (int i = 0; i < M; i++) {
        	map[i] = sc.nextInt();
        } int i = 0; int i = 0; i 0 i < M i M i++ i++ i {
        	map[i] = sc.nextInt();
        } {
        	map[i] = sc.nextInt();
        } map[i] = sc.nextInt() map[i] map i sc.nextInt() sc.nextInt sc int max = 0; max 0 for (int i = X; i < N; i++) {
        	for (int cost : map) {
        		if (i == cost) {
        			max++;
        		}
        	}
        } int i = X; int i = X; i X i < N i N i++ i++ i {
        	for (int cost : map) {
        		if (i == cost) {
        			max++;
        		}
        	}
        } {
        	for (int cost : map) {
        		if (i == cost) {
        			max++;
        		}
        	}
        } for (int cost : map) {
        		if (i == cost) {
        			max++;
        		}
        	} int cost map {
        		if (i == cost) {
        			max++;
        		}
        	} {
        		if (i == cost) {
        			max++;
        		}
        	} if (i == cost) {
        			max++;
        		} i == cost i cost {
        			max++;
        		} max++ max int min = 0; min 0 for (int i = X; 0 < i; i--) {
        	for (int cost : map) {
        		if (i == cost) {
        			min++;
        		}
        	}
        } int i = X; int i = X; i X 0 < i 0 i i-- i-- i {
        	for (int cost : map) {
        		if (i == cost) {
        			min++;
        		}
        	}
        } {
        	for (int cost : map) {
        		if (i == cost) {
        			min++;
        		}
        	}
        } for (int cost : map) {
        		if (i == cost) {
        			min++;
        		}
        	} int cost map {
        		if (i == cost) {
        			min++;
        		}
        	} {
        		if (i == cost) {
        			min++;
        		}
        	} if (i == cost) {
        			min++;
        		} i == cost i cost {
        			min++;
        		} min++ min System.out.println(Math.min(max, min)) System.out.println System.out System System.out Math.min(max, min) Math.min Math max min 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[] map = new int[M];
        for (int i = 0; i < M; i++) {
        	map[i] = sc.nextInt();
        }
        
        int max = 0;
        for (int i = X; i < N; i++) {
        	for (int cost : map) {
        		if (i == cost) {
        			max++;
        		}
        	}
        }
        
        int min = 0;
        for (int i = X; 0 < i; i--) {
        	for (int cost : map) {
        		if (i == cost) {
        			min++;
        		}
        	}
        }
        
        System.out.println(Math.min(max, min));
    }
} 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[] map = new int[M];
        for (int i = 0; i < M; i++) {
        	map[i] = sc.nextInt();
        }
        
        int max = 0;
        for (int i = X; i < N; i++) {
        	for (int cost : map) {
        		if (i == cost) {
        			max++;
        		}
        	}
        }
        
        int min = 0;
        for (int i = X; 0 < i; i--) {
        	for (int cost : map) {
        		if (i == cost) {
        			min++;
        		}
        	}
        }
        
        System.out.println(Math.min(max, min));
    }
} 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();
        
        int[] map = new int[M];
        for (int i = 0; i < M; i++) {
        	map[i] = sc.nextInt();
        }
        
        int max = 0;
        for (int i = X; i < N; i++) {
        	for (int cost : map) {
        		if (i == cost) {
        			max++;
        		}
        	}
        }
        
        int min = 0;
        for (int i = X; 0 < i; i--) {
        	for (int cost : map) {
        		if (i == cost) {
        			min++;
        		}
        	}
        }
        
        System.out.println(Math.min(max, min));
    }
}