#include <bits/stdc++.h>
using namespace std;

#define MAX 500000

int N, K;
int a[MAX];

int main() {
	cin >> N >> K;
	for( int i = 0; i < N; i++ ) {
		cin >> a[i];
	}

	sort( a, a + N );
	int t = 0;
	int ans = N;
	for( int i = N - 1; i >= 0; i-- ) {
		if( t + a[i] < K ) {
			t += a[i];
		}
		else {
			ans = min( ans, i );
		}
	}

	cout << ans << endl;

	return 0;
}
