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


// M A F I A - M A F I A - M A F I A - M A F I A - M A F I A - M A F I A //

#define int               long long
#define endl              '\n'
#define ff                first
#define ss                second
#define mp                make_pair
#define pb                push_back
#define vii               vector<int> 
#define pii               pair<int,int>
#define vpii              vector< pii >
#define all(v)            v.begin(),v.end()
#define loop(i,s,e)       for(int i=s;i<e;i++)
#define rloop(i,e,s)      for(int i=e;i>=s;i--)
#define mset(a,f)              memset(a,f,sizeof(a))
#define M                 1000000007
#define fastio            ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define prvec(v)          loop(i_u_j,0,v.size())cout << v[i_u_j] <<" "; cout << endl;
#define prarr(arr,n)      loop(i_u_j,0,n)cout << arr[i_u_j] << " "; cout << endl;
#define bug(...)        __f (#__VA_ARGS__, __VA_ARGS__)


template <typename Arg1>
void __f (const char* name, Arg1&& arg1) { cout << name << " : " << arg1 << endl; }
template <typename Arg1, typename... Args>
void __f (const char* names, Arg1&& arg1, Args&&... args)
{
     const char* comma = strchr (names + 1, ',');
     cout.write (names, comma - names) << " : " << arg1 << " | "; __f (comma + 1, args...);
}

// M A F I A - M A F I A - M A F I A - M A F I A - M A F I A - M A F I A //
const int N = 107;
const int inf = 1e18;
int n, W;
pii arr[N];
int  dp[N][100007];
int pmax[N];

// int getval(int it, int v, int mxw)
// {                 

//       if( mxw == 0 || it == n ) return dp[it][v] = 0;
//       int pw = pmax[ it ];
//       if( dp[it][v] != -1 and pw >= mxw ) 
//       {     
//             return dp[it][v];
//       }

//       if ( pmax[ it ] <= mxw ) pmax[ it ] = mxw;
//       int a = 0, b = 0;
//       b = getval(it+1, v, mxw);
//       if ( arr[it].ff <= mxw )
//       {     
//             a = arr[it].ss + getval(it+1, v + arr[it].ss,  mxw - arr[it].ff );
//       }


//       return dp[it][v] = max(dp[it][v], max(a,b));
// }

int getval(int it, int v)
{            
       // bug(it,v);     
      if( it == n ) return dp[it][v] = 0;  
      if( dp[it][v] != -1 ) return dp[it][v];
      int a = inf , b = inf;

      a = arr[it].ff + getval(it+1, v + arr[it].ss);
      b = getval(it+1, v );

      return dp[it][v] = min(a,b);
}

bool comp( pii &p1, pii &p2)
{
      if( p1. ff < p2.ff ) return 1;
      else if( p1.ff > p2.ff ) return 0;
      return p1.ss > p2.ss;
}
void solve()
{     
      int mxw;
      cin >> n >> mxw;
      W = mxw;
      // loop(i,0+1,n+1) cin >> arr[i].ff;
      // loop(i,0+1,n+1) cin >> arr[i].ss;
      loop(i,1,n+1)
      {
            cin >> arr[i].ff >> arr[i].ss;
      }

      loop(j,0,100002) dp[0][j] = inf;
      loop(i,0,n+1) dp[i][0] = 0;

      int ans = 0;
      loop(i,1,n+1)
      {
            loop(j,1,100002)
            {     
                  if( j - arr[i].ss >= 0 )
                     dp[i][j] = min( dp[i-1][ j - arr[i].ss ] + arr[i].ff, dp[i-1][j] );

                  else 
                     dp[i][j] = dp[i-1][j];
            }
      }

       loop(i,1,n+1)
      {
            loop(j,0,100002)
            {     
                  if( dp[i][j] <= W ) ans = max(ans, j);
            }
      }
      cout << ans ;
   
}

int32_t main() {
    fastio;

  
  int t = 1; 
  //cin>>t;
  
  while(t--) solve();
  
  


}


// M A F I A - M A F I A - M A F I A - M A F I A - M A F I A - M A F I A //















Measured memory_bytes: 80128