#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <cmath>
#include <map>
#include <queue>
#include <iomanip>
#include <set>
#include <tuple>
#define mkp make_pair
#define mkt make_tuple
#define rep(i,n) for(int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;
const ll MOD=1e9+7;

int dp[(1<<20)];

void chmax(int &a,int b){
  if(a<b) a=b;
}

int main(){
  int N;
  ll K;
  cin>>N>>K;
  vector<ll> A(N);
  rep(i,N) cin>>A[i];

  for(int i=1;i<(1<<N);i++){
    ll res=0;
    for(int j=0;j<N;j++){
      if(i&(1<<j)){
        chmax(dp[i],dp[i^(1<<j)]);
        res+=A[j];
      }
    }

    if(res==K) dp[i]=1;
  }

  int ans=N;
  for(int i=1;i<(1<<N);i++){
    if(dp[i]) continue;
    int num=0;
    for(int j=0;j<N;j++){
      if(i&(1<<j)) num++;
    }
    ans=min(ans,N-num);
  }

  cout<<ans<<endl;

  return 0;
}

