#define _USE_MATH_DEFINES
#include<stdio.h>
#include<string>
#include<iostream>
#include<cctype>
#include<cstdio>
#include<vector>
#include<queue>
#include<stack>
#include<algorithm>
#include<math.h>
#include<set>
#include<map>
#include<iomanip>
#include<functional>
#define ll long long
using namespace std;

ll N, K;
ll a[5050];

int main() {
	cin.tie(0); ios::sync_with_stdio(false);
	cin >> N >> K;
	for (int i = 0; i < N;i++) {
		cin >> a[i];
	}
	sort(a, a + N,greater<ll>());

	ll ans = -1;
	for (int i = 0; i < N;i++) {
		ll sum = 0;
		for (int j = i; j < N;j++) {
			if (sum + a[j] < K) {
				sum += a[j]; continue;
			}
			ans = max(ans, (ll)j);
		}
	}
	cout << N - ans - 1 << endl;
}