#include <stdio.h>


int main(){


int i, j, tmp=0;
int N,x;
static int a[1000000000];
int c=0;
int r=0;


scanf("%d%d", &N,&x); 


if(N<2 || 100<N){
printf("error");
return(0);

}


if(x<1 || 1000000000<x){
printf("error");
return(0);

}



	          
scanf("%d", a);
 

//count = count + a[i];

for( i = 0 ; i < N ; i++){

scanf("%d", &a[i]);

	if(a[i]<1 || 1000000000<a[i]){
		printf("error");
		return(0);

	}	
}



for (i=0; i<N; ++i) { 


    for (j=i+1; j<N; ++j) { 


      if (a[i] > a[j]) { 


        tmp =  a[i]; 


        a[i] = a[j]; 


        a[j] = tmp; 


      } 


    } 


} 

i=0;
j=0;


while(r < x){

r= r +1;//全体カウント

j = j+1;


if (j == a[i]){

 //c = c+1; //子供の数数え
 
 i=i+1;
 j=0;
 
 if(i==N){
   r = x + 1;
 }

}


}




if(r == x + 1){

printf("%d\n",N);

	
}else{

 printf("%d\n",i);

}





     
    
   return(0);
}


