// Arup Guha
// 4/21/2021
// Solution to 2021 USACO April Silver Problem: Acowdemia

import java.util.*;

public class acowdemia_alt {

	public static int n;
	public static int numArticles;
	public static int maxCite;
	public static int[] vals;
	
	public static void main(String[] args) {
	
		// Get input and sort.
		Scanner stdin = new Scanner(System.in);
		n = stdin.nextInt();
		numArticles = stdin.nextInt();
		maxCite = stdin.nextInt();
		vals = new int[n];
		for (int i=0; i<n; i++)
			vals[i] = stdin.nextInt();
		Arrays.sort(vals);
		
		// Get current h-index.
		int hIdx = 1;
		while (hIdx <= n && vals[n-hIdx] >= hIdx) hIdx++;
		hIdx--;
		
		// Silly exception case.
		if (maxCite == 0 || numArticles == 0)
			System.out.println(hIdx);
		
		// Normal case.
		else {
		
			// Binary search the best possible h-Index.
			int low = hIdx, high = n;
			while (low < high) {
			
				int mid = (low+high+1)/2;
				
				if (canDo(mid))
					low = mid;
				else
					high = mid-1;
			}
			
			// Ta da!
			System.out.println(low);
		}
	}
	
	// Returns true iff we can get an hindex of tryVal.
	public static boolean canDo(int tryVal) {
	
		long need = 0;
		int max = 0;
		
		// Gather how many citations each paper needs to get to hIndex tryVal.
		// and the most needy paper.
		for (int i=n-1,j=0; j<tryVal; i--,j++) {
			if (vals[i] < tryVal) {
				need += (tryVal-vals[i]);
				max = Math.max(max, tryVal-vals[i]);
			}
		}
		
		// This is a limiting factor. If one paper needs too many citations, we just can't do it.
		if (max > numArticles) return false;
		
		// See if we have enough room to cite all the articles we need to cite.
		return ((long)numArticles)*maxCite >= need;
	}
}