#include <cstdio>
#include <cstring>
#include <iostream>
#include <cmath>
#include <algorithm>
#include <sstream>
#include <string>
#include <set>
#include <queue>
using namespace std;
#define mem(a,n) memset(a,n,sizeof(a))
#define pb(x) push_back(x)
typedef long long ll;
typedef unsigned long long ull;
const int mod=1e9+7;
const double eps=1e-6;
const int INF=0x3f3f3f3f;
const int N=100+5;
int main()
{
    int n,k;
    cin>>n>>k;
    int cnt=n,sum=0;
    vector<int> a(n);
    for(int i=0; i<n; i++)
        cin>>a[i];
    sort(a.begin(),a.end());
    for(int i=n-1; i>=0; i--)
    {
        if(sum+a[i]<k) sum+=a[i];
        else cnt=i;
    }
    cout<<cnt<<endl;
    return 0;
}
