#include<cstdio>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<iostream>
const int MaxN = 1e4;
typedef long long LL;
using namespace std;
bool cmp(LL x , LL y){
	return x > y;
}
int k , n;
LL a[MaxN + 5];
int main()
{
		scanf("%d%d" , &n , &k );
		int Max = 0;
		for(int i = 1;i <= n;i++)
			scanf("%lld" , &a[i]);
		sort(a + 1 , a + n + 1 ,cmp);
		for(int i = 1;i <= n;i++){
			LL sum = 0;
			for(int j = i;j <= n;j++){
				sum += a[j];
				if(sum >= k){
					Max = max(Max , j);
					sum -= a[j];
				}
			}
		}
		cout << n - Max << endl;
}