#include<iostream>
#include<cstdio>
#include<vector>
using namespace std;
typedef vector<int> VI;
typedef vector<VI> VVI;
int ans,U;

void dfs(VI& G,VI& c,int total,int cost,int b)
{
  if(cost >= ans)
    return;

  int n = G.size();
  for(int i=0;i<n;i++)
    {
      if((b>>i) & 1)
	continue;
      int pre = G[i];
      pre &= b;
      if(pre == G[i])
	{
	  if(total+c[i] < U)
	    dfs(G,c,total+c[i],cost+1,b|(1<<i));
	  else 
	    ans = min(ans,cost+1);
	}
    }

}

int main()
{
  int n;
  while(cin >> n >> U,n|U)
    {
      vector<int> G;
      G.resize(n);
      vector<int> c; 
      c.resize(n);
      for(int i=0;i<n;i++)
	{
	  int k;
	  cin >> c[i] >> k;
	  G[i] = 0;
	  for(int j=0;j<k;j++)
	    {
	      int r;
	      cin >> r;
	      G[i] |= (1<<r);
	    }
	}

      ans = n;
      dfs(G,c,0,0,0);
      cout << ans << endl;
    }
  return 0;
}